@ryuenn3123/agentic-senior-core 4.3.15 → 5.1.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 (198) hide show
  1. package/.agents/plugins/marketplace.json +21 -0
  2. package/.agents/rules/agentic-senior-core.md +126 -0
  3. package/.claude-plugin/marketplace.json +17 -0
  4. package/.claude-plugin/plugin.json +17 -0
  5. package/.clinerules/agentic-senior-core.md +94 -0
  6. package/.codex-plugin/plugin.json +24 -0
  7. package/.cursor/rules/agentic-senior-core.mdc +99 -0
  8. package/.devin-plugin/plugin.json +13 -0
  9. package/.github/copilot-instructions.md +94 -0
  10. package/.github/plugin/marketplace.json +20 -0
  11. package/.github/plugin/plugin.json +16 -0
  12. package/.kiro/steering/agentic-senior-core.md +94 -0
  13. package/.openclaw/skills/asc/SKILL.md +23 -0
  14. package/.openclaw/skills/asc-audit/SKILL.md +28 -0
  15. package/.openclaw/skills/asc-review/SKILL.md +54 -0
  16. package/.opencode/plugins/agentic-senior-core.mjs +31 -0
  17. package/.windsurf/rules/agentic-senior-core.md +94 -0
  18. package/AGENTS.md +126 -179
  19. package/CONTRIBUTING.md +93 -63
  20. package/README.md +160 -111
  21. package/__init__.py +61 -0
  22. package/bin/agentic-senior-core.js +41 -43
  23. package/commands/asc-audit.md +1 -0
  24. package/commands/asc-audit.toml +2 -0
  25. package/commands/asc-help.md +9 -0
  26. package/commands/asc-help.toml +2 -0
  27. package/commands/asc-refactor.md +1 -0
  28. package/commands/asc-refactor.toml +2 -0
  29. package/commands/asc-review.md +1 -0
  30. package/commands/asc-review.toml +2 -0
  31. package/gemini-extension.json +10 -0
  32. package/hooks/copilot-hooks.json +21 -0
  33. package/hooks/hooks.json +31 -0
  34. package/hooks/session-start.js +36 -0
  35. package/hooks/subagent-start.js +38 -0
  36. package/lib/cli/commands/adapter.mjs +109 -0
  37. package/lib/cli/commands/clean.mjs +63 -0
  38. package/lib/cli/commands/status.mjs +94 -0
  39. package/package.json +43 -67
  40. package/plugin.yaml +16 -0
  41. package/scripts/uninstall.js +38 -0
  42. package/skills/asc/SKILL.md +16 -0
  43. package/skills/asc-audit/SKILL.md +28 -0
  44. package/skills/asc-refactor/SKILL.md +35 -0
  45. package/skills/asc-review/SKILL.md +54 -0
  46. package/.agent-context/policies/llm-judge-threshold.json +0 -29
  47. package/.agent-context/prompts/bootstrap-design.md +0 -63
  48. package/.agent-context/prompts/compact-natural-mode.md +0 -100
  49. package/.agent-context/prompts/init-project.md +0 -60
  50. package/.agent-context/prompts/refactor.md +0 -38
  51. package/.agent-context/prompts/review-code.md +0 -31
  52. package/.agent-context/review-checklists/architecture-review.md +0 -57
  53. package/.agent-context/review-checklists/pr-checklist.md +0 -136
  54. package/.agent-context/rules/api-docs.md +0 -24
  55. package/.agent-context/rules/api-versioning.md +0 -16
  56. package/.agent-context/rules/architecture.md +0 -33
  57. package/.agent-context/rules/background-jobs.md +0 -17
  58. package/.agent-context/rules/config-and-flags.md +0 -16
  59. package/.agent-context/rules/database-design.md +0 -18
  60. package/.agent-context/rules/docker-runtime.md +0 -17
  61. package/.agent-context/rules/error-handling.md +0 -16
  62. package/.agent-context/rules/event-driven.md +0 -16
  63. package/.agent-context/rules/frontend-architecture.md +0 -54
  64. package/.agent-context/rules/microservices.md +0 -16
  65. package/.agent-context/rules/migrations.md +0 -16
  66. package/.agent-context/rules/observability.md +0 -16
  67. package/.agent-context/rules/performance.md +0 -16
  68. package/.agent-context/rules/realtime.md +0 -16
  69. package/.agent-context/rules/resilience.md +0 -18
  70. package/.agent-context/rules/security.md +0 -18
  71. package/.agent-context/rules/testing.md +0 -16
  72. package/.agent-context/state/README.md +0 -25
  73. package/.agent-context/state/architecture-map.md +0 -40
  74. package/.agent-context/state/benchmark-comparison-schema.json +0 -181
  75. package/.agent-context/state/benchmark-reproducibility.json +0 -87
  76. package/.agent-context/state/benchmark-thresholds.json +0 -10
  77. package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
  78. package/.agent-context/state/dependency-map.md +0 -41
  79. package/.agent-context/state/memory-adapter-contract.json +0 -52
  80. package/.agent-context/state/memory-schema-v1.json +0 -88
  81. package/GEMINI.md +0 -1
  82. package/benchmarks/README.md +0 -60
  83. package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
  84. package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
  85. package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
  86. package/lib/cli/adaptive-context/catalog.mjs +0 -390
  87. package/lib/cli/adaptive-context/file-signals.mjs +0 -100
  88. package/lib/cli/adaptive-context/implications.mjs +0 -44
  89. package/lib/cli/adaptive-context.mjs +0 -365
  90. package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
  91. package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
  92. package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
  93. package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
  94. package/lib/cli/backup.mjs +0 -210
  95. package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
  96. package/lib/cli/commands/context.mjs +0 -140
  97. package/lib/cli/commands/init/project-context.mjs +0 -60
  98. package/lib/cli/commands/init/runtime-environment.mjs +0 -59
  99. package/lib/cli/commands/init/setup-decisions.mjs +0 -83
  100. package/lib/cli/commands/init.mjs +0 -654
  101. package/lib/cli/commands/launch.mjs +0 -76
  102. package/lib/cli/commands/optimize.mjs +0 -284
  103. package/lib/cli/commands/rollback.mjs +0 -64
  104. package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
  105. package/lib/cli/commands/upgrade.mjs +0 -451
  106. package/lib/cli/compiler.mjs +0 -570
  107. package/lib/cli/constants.mjs +0 -136
  108. package/lib/cli/detector/constants.mjs +0 -135
  109. package/lib/cli/detector/design-evidence/collector.mjs +0 -256
  110. package/lib/cli/detector/design-evidence/constants.mjs +0 -39
  111. package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
  112. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
  113. package/lib/cli/detector/design-evidence/summary.mjs +0 -109
  114. package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
  115. package/lib/cli/detector/design-evidence.mjs +0 -25
  116. package/lib/cli/detector/stack-detection.mjs +0 -243
  117. package/lib/cli/detector/ui-signals.mjs +0 -150
  118. package/lib/cli/detector/workspace-scan.mjs +0 -177
  119. package/lib/cli/detector.mjs +0 -23
  120. package/lib/cli/init-detection-flow.mjs +0 -48
  121. package/lib/cli/init-options.mjs +0 -237
  122. package/lib/cli/init-selection.mjs +0 -29
  123. package/lib/cli/memory-continuity.mjs +0 -537
  124. package/lib/cli/preflight.mjs +0 -76
  125. package/lib/cli/project-scaffolder/constants.mjs +0 -69
  126. package/lib/cli/project-scaffolder/discovery.mjs +0 -272
  127. package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
  128. package/lib/cli/project-scaffolder/storage.mjs +0 -144
  129. package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
  130. package/lib/cli/project-scaffolder.mjs +0 -29
  131. package/lib/cli/rollback.mjs +0 -66
  132. package/lib/cli/token-optimization.mjs +0 -486
  133. package/lib/cli/utils/filesystem.mjs +0 -81
  134. package/lib/cli/utils/managed-surface.mjs +0 -280
  135. package/lib/cli/utils/prompting.mjs +0 -44
  136. package/lib/cli/utils.mjs +0 -479
  137. package/mcp.json +0 -134
  138. package/scripts/adaptive-context/fixtures.mjs +0 -183
  139. package/scripts/adaptive-context-benchmark.mjs +0 -9
  140. package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
  141. package/scripts/audit-cache-layer-contract.mjs +0 -263
  142. package/scripts/audit-caching-scope-hygiene.mjs +0 -268
  143. package/scripts/audit-file-size.mjs +0 -219
  144. package/scripts/audit-reflection-citations.mjs +0 -163
  145. package/scripts/audit-release-bundle.mjs +0 -170
  146. package/scripts/audit-rule-id-uniqueness.mjs +0 -313
  147. package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
  148. package/scripts/benchmark-evidence-bundle.mjs +0 -645
  149. package/scripts/benchmark-gate.mjs +0 -121
  150. package/scripts/benchmark-intelligence.mjs +0 -33
  151. package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
  152. package/scripts/build-release-benchmark-bundle.mjs +0 -202
  153. package/scripts/bump-version.mjs +0 -103
  154. package/scripts/clean-local-artifacts.mjs +0 -78
  155. package/scripts/compact-natural-mode-benchmark.mjs +0 -9
  156. package/scripts/context-triggered-audit.mjs +0 -391
  157. package/scripts/detection-benchmark.mjs +0 -127
  158. package/scripts/docs-quality-drift-report.mjs +0 -358
  159. package/scripts/documentation-boundary-audit.mjs +0 -305
  160. package/scripts/explain-on-demand-audit.mjs +0 -427
  161. package/scripts/forbidden-content-check.mjs +0 -123
  162. package/scripts/frontend-usability-audit.mjs +0 -243
  163. package/scripts/generate-sbom.mjs +0 -61
  164. package/scripts/governance-weekly-report.mjs +0 -466
  165. package/scripts/llm-judge/checklist-loader.mjs +0 -45
  166. package/scripts/llm-judge/constants.mjs +0 -66
  167. package/scripts/llm-judge/diff-collection.mjs +0 -74
  168. package/scripts/llm-judge/prompting.mjs +0 -78
  169. package/scripts/llm-judge/providers.mjs +0 -111
  170. package/scripts/llm-judge/verdict.mjs +0 -134
  171. package/scripts/llm-judge.mjs +0 -200
  172. package/scripts/memory-continuity-benchmark.mjs +0 -322
  173. package/scripts/quality-trend-report.mjs +0 -289
  174. package/scripts/release-gate/audit-checks.mjs +0 -441
  175. package/scripts/release-gate/constants.mjs +0 -53
  176. package/scripts/release-gate/runtime.mjs +0 -63
  177. package/scripts/release-gate/static-checks.mjs +0 -182
  178. package/scripts/release-gate.mjs +0 -42
  179. package/scripts/rules-guardian-audit.mjs +0 -580
  180. package/scripts/single-source-lazy-loading-audit.mjs +0 -449
  181. package/scripts/sync-thin-adapters.mjs +0 -72
  182. package/scripts/token-optimization-benchmark.mjs +0 -252
  183. package/scripts/ui-design-judge/constants.mjs +0 -13
  184. package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
  185. package/scripts/ui-design-judge/git-input.mjs +0 -134
  186. package/scripts/ui-design-judge/prompting.mjs +0 -52
  187. package/scripts/ui-design-judge/providers.mjs +0 -102
  188. package/scripts/ui-design-judge/reporting.mjs +0 -183
  189. package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
  190. package/scripts/ui-design-judge/rubric-goldset.json +0 -188
  191. package/scripts/ui-design-judge.mjs +0 -319
  192. package/scripts/ui-rubric-calibration.mjs +0 -35
  193. package/scripts/validate/config.mjs +0 -519
  194. package/scripts/validate/coverage-checks.mjs +0 -446
  195. package/scripts/validate/file-structure.mjs +0 -162
  196. package/scripts/validate/markdown-content.mjs +0 -109
  197. package/scripts/validate/project-metadata.mjs +0 -166
  198. package/scripts/validate.mjs +0 -338
@@ -1,183 +0,0 @@
1
- // @ts-check
2
-
3
- import { detectCiProvider } from './git-input.mjs';
4
-
5
- function normalizeSeverity(rawSeverityValue) {
6
- const normalizedSeverityValue = String(rawSeverityValue || '').trim().toLowerCase();
7
-
8
- if (['critical', 'high', 'medium', 'low'].includes(normalizedSeverityValue)) {
9
- return normalizedSeverityValue;
10
- }
11
-
12
- if (normalizedSeverityValue === 'major') {
13
- return 'high';
14
- }
15
-
16
- if (normalizedSeverityValue === 'minor' || normalizedSeverityValue === 'info') {
17
- return 'low';
18
- }
19
-
20
- return 'low';
21
- }
22
-
23
- export function extractVerdictObject(rawResponseText) {
24
- const verdictMatch = rawResponseText.match(/JSON_VERDICT:\s*(\{[\s\S]*\})/i);
25
- if (!verdictMatch) {
26
- return { verdict: null, malformed: true };
27
- }
28
-
29
- try {
30
- return {
31
- verdict: JSON.parse(verdictMatch[1]),
32
- malformed: false,
33
- };
34
- } catch {
35
- return {
36
- verdict: null,
37
- malformed: true,
38
- };
39
- }
40
- }
41
-
42
- export function normalizeFindings(rawFindings) {
43
- if (!Array.isArray(rawFindings)) {
44
- return [];
45
- }
46
-
47
- return rawFindings.map((rawFinding) => ({
48
- area: String(rawFinding?.area || 'general'),
49
- severity: normalizeSeverity(rawFinding?.severity),
50
- problem: String(rawFinding?.problem || 'No problem description provided.'),
51
- evidence: String(rawFinding?.evidence || 'No evidence provided.'),
52
- requiredAction: String(rawFinding?.requiredAction || 'No required action provided.'),
53
- blockingRecommended: rawFinding?.blockingRecommended === true,
54
- }));
55
- }
56
-
57
- function normalizeRubricVerdict(rawVerdictValue) {
58
- const normalizedVerdictValue = String(rawVerdictValue || '').trim().toLowerCase();
59
- if (['strong', 'acceptable', 'weak', 'unclear'].includes(normalizedVerdictValue)) {
60
- return normalizedVerdictValue;
61
- }
62
- return 'unclear';
63
- }
64
-
65
- export function normalizeRubricBreakdown(rawRubricBreakdown, expectedDimensions = []) {
66
- if (!Array.isArray(rawRubricBreakdown)) {
67
- return [];
68
- }
69
-
70
- const expectedDimensionNames = Array.isArray(expectedDimensions)
71
- ? expectedDimensions.map((dimension) => String(dimension || '').trim()).filter(Boolean)
72
- : [];
73
-
74
- return rawRubricBreakdown
75
- .map((rawDimensionEntry) => ({
76
- dimension: String(rawDimensionEntry?.dimension || '').trim(),
77
- score: typeof rawDimensionEntry?.score === 'number' && Number.isFinite(rawDimensionEntry.score)
78
- ? rawDimensionEntry.score
79
- : null,
80
- verdict: normalizeRubricVerdict(rawDimensionEntry?.verdict),
81
- reason: String(rawDimensionEntry?.reason || 'No rubric reason provided.'),
82
- blocking: rawDimensionEntry?.blocking === true,
83
- }))
84
- .filter((dimensionEntry) => {
85
- if (!dimensionEntry.dimension) {
86
- return false;
87
- }
88
- return expectedDimensionNames.length === 0 || expectedDimensionNames.includes(dimensionEntry.dimension);
89
- });
90
- }
91
-
92
- export function normalizeGenericityAssessment(rawGenericityAssessment) {
93
- const normalizedStatus = String(rawGenericityAssessment?.status || '').trim().toLowerCase();
94
- return {
95
- status: ['distinctive', 'mixed', 'generic', 'unclear'].includes(normalizedStatus)
96
- ? normalizedStatus
97
- : 'unclear',
98
- reason: String(rawGenericityAssessment?.reason || 'No genericity assessment provided.'),
99
- };
100
- }
101
-
102
- export function buildReport(partialReport) {
103
- return {
104
- generatedAt: new Date().toISOString(),
105
- auditName: 'ui-design-judge',
106
- schemaVersion: '1.2',
107
- mode: 'advisory',
108
- advisoryOnly: true,
109
- passed: true,
110
- autoFailTriggered: false,
111
- skipped: false,
112
- skipReason: null,
113
- provider: 'none',
114
- ciProvider: detectCiProvider(),
115
- contractPresent: false,
116
- summary: {
117
- changedUiFileCount: 0,
118
- alignmentScore: null,
119
- driftCount: 0,
120
- blockingCandidateCount: 0,
121
- designExecutionSignalCount: 0,
122
- genericityStatus: 'unclear',
123
- },
124
- designExecution: {
125
- policyPresent: false,
126
- representationStrategy: null,
127
- contractReady: false,
128
- screenshotDependencyForbidden: false,
129
- repoEvidenceAvailable: false,
130
- handoffPresent: false,
131
- handoffVersion: null,
132
- handoffReady: false,
133
- handoffArtifactCount: 0,
134
- presentHandoffArtifacts: [],
135
- missingHandoffArtifacts: [],
136
- repoEvidenceSummaryVersion: null,
137
- requiredCapabilities: [],
138
- enabledCapabilities: [],
139
- missingCapabilities: [],
140
- semanticReviewFocus: [],
141
- notes: [],
142
- },
143
- rubric: {
144
- expectedDimensions: [],
145
- breakdown: [],
146
- genericityAssessment: {
147
- status: 'unclear',
148
- reason: 'No genericity assessment provided.',
149
- },
150
- tasteVsFailureSeparated: null,
151
- calibration: {
152
- version: 'ui-rubric-calibration-v1',
153
- providerStatus: 'unclear',
154
- calibratedStatus: 'unclear',
155
- statusChanged: false,
156
- namedGenericityRequired: false,
157
- matchedGenericitySignals: [],
158
- matchedForbiddenPatterns: [],
159
- matchedValidBoldSignals: [],
160
- blockingFindingCount: 0,
161
- contractFidelityWeak: false,
162
- contractDriftDetected: false,
163
- tasteVsFailureSeparated: null,
164
- evidenceTextCount: 0,
165
- notes: ['No rubric calibration was performed.'],
166
- },
167
- },
168
- semanticJudge: {
169
- attempted: false,
170
- skipped: false,
171
- skipReason: null,
172
- },
173
- malformedVerdict: false,
174
- providerError: false,
175
- findings: [],
176
- notes: [],
177
- ...partialReport,
178
- };
179
- }
180
-
181
- export function emitMachineReadableReport(machineReportPayload) {
182
- console.log(JSON.stringify(machineReportPayload, null, 2));
183
- }
@@ -1,214 +0,0 @@
1
- // @ts-check
2
-
3
- function normalizeForSignalMatch(rawValue) {
4
- return String(rawValue || '')
5
- .toLowerCase()
6
- .replace(/[^a-z0-9]+/g, ' ')
7
- .trim()
8
- .replace(/\s+/g, ' ');
9
- }
10
-
11
- function collectEvidenceTexts({
12
- genericityAssessment,
13
- rubricBreakdown,
14
- findings,
15
- notes,
16
- }) {
17
- const textParts = [
18
- genericityAssessment?.reason,
19
- ...(Array.isArray(rubricBreakdown)
20
- ? rubricBreakdown.flatMap((dimensionEntry) => [dimensionEntry?.dimension, dimensionEntry?.reason])
21
- : []),
22
- ...(Array.isArray(findings)
23
- ? findings.flatMap((finding) => [
24
- finding?.area,
25
- finding?.problem,
26
- finding?.evidence,
27
- finding?.requiredAction,
28
- ])
29
- : []),
30
- ...(Array.isArray(notes) ? notes : []),
31
- ];
32
-
33
- return textParts
34
- .map((textValue) => normalizeForSignalMatch(textValue))
35
- .filter(Boolean);
36
- }
37
-
38
- export function collectMatchedSignals(signalList, evidenceTexts) {
39
- const normalizedEvidenceText = Array.isArray(evidenceTexts)
40
- ? evidenceTexts.join(' ')
41
- : normalizeForSignalMatch(evidenceTexts);
42
-
43
- if (!normalizedEvidenceText) {
44
- return [];
45
- }
46
-
47
- return (Array.isArray(signalList) ? signalList : [])
48
- .map((signalValue) => ({
49
- raw: String(signalValue || '').trim(),
50
- normalized: normalizeForSignalMatch(signalValue),
51
- }))
52
- .filter((signalEntry) => signalEntry.raw && signalEntry.normalized)
53
- .filter((signalEntry) => normalizedEvidenceText.includes(signalEntry.normalized))
54
- .map((signalEntry) => signalEntry.raw);
55
- }
56
-
57
- function detectContractDrift(rubricBreakdown, findings, designExecutionSummary) {
58
- const contractFidelityEntry = Array.isArray(rubricBreakdown)
59
- ? rubricBreakdown.find((dimensionEntry) => dimensionEntry?.dimension === 'contractFidelity')
60
- : null;
61
- const blockingFindingCount = Array.isArray(findings)
62
- ? findings.filter((finding) => finding?.blockingRecommended === true || ['critical', 'high'].includes(String(finding?.severity || '').toLowerCase())).length
63
- : 0;
64
- const contractFidelityWeak = contractFidelityEntry
65
- ? contractFidelityEntry.verdict === 'weak'
66
- || contractFidelityEntry.verdict === 'unclear'
67
- || (typeof contractFidelityEntry.score === 'number' && contractFidelityEntry.score < 70)
68
- : false;
69
- const contractReady = designExecutionSummary?.contractReady === true;
70
-
71
- return {
72
- blockingFindingCount,
73
- contractFidelityWeak,
74
- contractDriftDetected: !contractReady || contractFidelityWeak || blockingFindingCount > 0,
75
- };
76
- }
77
-
78
- export function calibrateGenericityAssessment({
79
- reviewRubricSummary,
80
- designExecutionSummary,
81
- genericityAssessment,
82
- rubricBreakdown,
83
- findings,
84
- notes,
85
- tasteVsFailureSeparated,
86
- }) {
87
- const providerStatus = String(genericityAssessment?.status || 'unclear').trim().toLowerCase() || 'unclear';
88
- const evidenceTexts = collectEvidenceTexts({
89
- genericityAssessment,
90
- rubricBreakdown,
91
- findings,
92
- notes,
93
- });
94
- const matchedGenericitySignals = collectMatchedSignals(reviewRubricSummary?.genericitySignals, evidenceTexts);
95
- const matchedValidBoldSignals = collectMatchedSignals(reviewRubricSummary?.validBoldSignals, evidenceTexts);
96
- const matchedForbiddenPatterns = collectMatchedSignals(reviewRubricSummary?.forbiddenPatterns, evidenceTexts);
97
- const { blockingFindingCount, contractFidelityWeak, contractDriftDetected } = detectContractDrift(
98
- rubricBreakdown,
99
- findings,
100
- designExecutionSummary
101
- );
102
- const namedGenericityRequired = reviewRubricSummary?.reportingRules?.mustExplainGenericity === true;
103
- const calibrationNotes = [];
104
- let calibratedStatus = providerStatus;
105
-
106
- if (
107
- namedGenericityRequired
108
- && ['generic', 'mixed'].includes(providerStatus)
109
- && matchedGenericitySignals.length === 0
110
- && matchedForbiddenPatterns.length === 0
111
- ) {
112
- calibratedStatus = 'unclear';
113
- calibrationNotes.push('Genericity claim was not backed by any named drift signal.');
114
- }
115
-
116
- if ((matchedGenericitySignals.length > 0 || matchedForbiddenPatterns.length > 0) && matchedValidBoldSignals.length === 0) {
117
- calibratedStatus = contractDriftDetected || matchedGenericitySignals.length + matchedForbiddenPatterns.length >= 2
118
- ? 'generic'
119
- : 'mixed';
120
- calibrationNotes.push('Named genericity drift signals dominate the review evidence.');
121
- } else if (matchedValidBoldSignals.length > 0 && matchedGenericitySignals.length === 0 && matchedForbiddenPatterns.length === 0) {
122
- if (contractDriftDetected) {
123
- calibratedStatus = 'mixed';
124
- calibrationNotes.push('Authored signals are present, but contract drift prevents a distinctive verdict.');
125
- } else if (matchedValidBoldSignals.length >= 2) {
126
- calibratedStatus = 'distinctive';
127
- calibrationNotes.push('Multiple valid bold signals were named without generic drift evidence.');
128
- } else if (providerStatus === 'unclear') {
129
- calibratedStatus = 'mixed';
130
- calibrationNotes.push('One valid bold signal was named, but evidence is not strong enough for a distinctive verdict.');
131
- }
132
- } else if ((matchedGenericitySignals.length > 0 || matchedForbiddenPatterns.length > 0) && matchedValidBoldSignals.length > 0) {
133
- calibratedStatus = contractDriftDetected ? 'mixed' : 'mixed';
134
- calibrationNotes.push('The evidence contains both generic drift and legitimate authored moves.');
135
- } else if (providerStatus === 'distinctive' && contractDriftDetected) {
136
- calibratedStatus = 'mixed';
137
- calibrationNotes.push('Distinctive tone does not override contract drift or blocking findings.');
138
- }
139
-
140
- if (tasteVsFailureSeparated === false && calibratedStatus === 'distinctive') {
141
- calibratedStatus = 'mixed';
142
- calibrationNotes.push('The review did not separate taste preference from real failure conditions.');
143
- }
144
-
145
- if (calibrationNotes.length === 0) {
146
- calibrationNotes.push('Provider verdict stayed intact after rubric calibration.');
147
- }
148
-
149
- return {
150
- version: 'ui-rubric-calibration-v1',
151
- providerStatus,
152
- calibratedStatus,
153
- statusChanged: calibratedStatus !== providerStatus,
154
- namedGenericityRequired,
155
- matchedGenericitySignals,
156
- matchedForbiddenPatterns,
157
- matchedValidBoldSignals,
158
- blockingFindingCount,
159
- contractFidelityWeak,
160
- contractDriftDetected,
161
- tasteVsFailureSeparated,
162
- evidenceTextCount: evidenceTexts.length,
163
- notes: calibrationNotes,
164
- };
165
- }
166
-
167
- export function buildRubricCalibrationReport({
168
- cases,
169
- reviewRubricSummary,
170
- }) {
171
- const normalizedCases = Array.isArray(cases) ? cases : [];
172
- const results = normalizedCases.map((caseEntry) => {
173
- const calibration = calibrateGenericityAssessment({
174
- reviewRubricSummary,
175
- designExecutionSummary: caseEntry.designExecutionSummary,
176
- genericityAssessment: caseEntry.genericityAssessment,
177
- rubricBreakdown: caseEntry.rubricBreakdown,
178
- findings: caseEntry.findings,
179
- notes: caseEntry.notes,
180
- tasteVsFailureSeparated: caseEntry.tasteVsFailureSeparated,
181
- });
182
- const expected = caseEntry.expected && typeof caseEntry.expected === 'object'
183
- ? caseEntry.expected
184
- : {};
185
-
186
- const statusMatches = String(expected.calibratedStatus || '') === calibration.calibratedStatus;
187
- const contractDriftMatches = typeof expected.contractDriftDetected === 'boolean'
188
- ? expected.contractDriftDetected === calibration.contractDriftDetected
189
- : true;
190
-
191
- return {
192
- id: String(caseEntry.id || 'unknown-case'),
193
- label: String(caseEntry.label || ''),
194
- passed: statusMatches && contractDriftMatches,
195
- expected,
196
- calibration,
197
- };
198
- });
199
-
200
- const passedCaseCount = results.filter((resultEntry) => resultEntry.passed).length;
201
- const totalCases = results.length;
202
-
203
- return {
204
- generatedAt: new Date().toISOString(),
205
- reportName: 'ui-rubric-calibration',
206
- schemaVersion: '1.0',
207
- passed: passedCaseCount === totalCases,
208
- failureCount: totalCases - passedCaseCount,
209
- totalCases,
210
- passedCaseCount,
211
- accuracyPercent: totalCases === 0 ? 0 : Number(((passedCaseCount / totalCases) * 100).toFixed(1)),
212
- results,
213
- };
214
- }
@@ -1,188 +0,0 @@
1
- {
2
- "version": "ui-rubric-goldset-v1",
3
- "reviewRubric": {
4
- "version": "ui-rubric-v1",
5
- "genericitySignals": [
6
- "safe-centered-hero-without-product-rationale",
7
- "balanced-card-grid-without-priority-shift",
8
- "default-framework-button-and-input-treatment",
9
- "trend-gradient-without-structural-role",
10
- "interchangeable-dashboard-chrome"
11
- ],
12
- "validBoldSignals": [
13
- "one-clear-signature-move",
14
- "project-specific-layout-tension",
15
- "purposeful-motion-as-identity",
16
- "distinct-typographic-hierarchy",
17
- "non-template-task-priority"
18
- ],
19
- "reportingRules": {
20
- "mustExplainGenericity": true,
21
- "mustSeparateTasteFromFailure": true,
22
- "contractFidelityOverridesPersonalTaste": true
23
- }
24
- },
25
- "cases": [
26
- {
27
- "id": "distinctive-authored-valid",
28
- "label": "Authored UI with clear valid bold signals and no contract drift",
29
- "designExecutionSummary": {
30
- "contractReady": true
31
- },
32
- "genericityAssessment": {
33
- "status": "distinctive",
34
- "reason": "The UI lands one clear signature move with project specific layout tension and non template task priority."
35
- },
36
- "rubricBreakdown": [
37
- {
38
- "dimension": "contractFidelity",
39
- "score": 88,
40
- "verdict": "strong",
41
- "reason": "Contract fidelity stays intact while the layout uses non template task priority.",
42
- "blocking": true
43
- }
44
- ],
45
- "findings": [],
46
- "notes": [
47
- "The composition keeps one clear signature move instead of collapsing into default chrome."
48
- ],
49
- "tasteVsFailureSeparated": true,
50
- "expected": {
51
- "calibratedStatus": "distinctive",
52
- "contractDriftDetected": false
53
- }
54
- },
55
- {
56
- "id": "bold-but-contract-drift",
57
- "label": "Bold ideas exist but contract drift keeps the result mixed",
58
- "designExecutionSummary": {
59
- "contractReady": true
60
- },
61
- "genericityAssessment": {
62
- "status": "distinctive",
63
- "reason": "There is project specific layout tension and one clear signature move, but the mobile hierarchy drifted."
64
- },
65
- "rubricBreakdown": [
66
- {
67
- "dimension": "contractFidelity",
68
- "score": 54,
69
- "verdict": "weak",
70
- "reason": "Contract fidelity weakened when the primary CTA moved below secondary content.",
71
- "blocking": true
72
- }
73
- ],
74
- "findings": [
75
- {
76
- "area": "responsive",
77
- "severity": "high",
78
- "problem": "Mobile layout no longer follows the contract.",
79
- "evidence": "The primary action now drops below supporting proof.",
80
- "requiredAction": "Restore the intended task order.",
81
- "blockingRecommended": true
82
- }
83
- ],
84
- "notes": [
85
- "The distinctive direction is real, but contract fidelity still drifted."
86
- ],
87
- "tasteVsFailureSeparated": true,
88
- "expected": {
89
- "calibratedStatus": "mixed",
90
- "contractDriftDetected": true
91
- }
92
- },
93
- {
94
- "id": "generic-template-drift",
95
- "label": "Generic template drift is named clearly and stays generic",
96
- "designExecutionSummary": {
97
- "contractReady": false
98
- },
99
- "genericityAssessment": {
100
- "status": "mixed",
101
- "reason": "The redesign fell back to balanced card grid without priority shift plus default framework button and input treatment."
102
- },
103
- "rubricBreakdown": [
104
- {
105
- "dimension": "contractFidelity",
106
- "score": 49,
107
- "verdict": "weak",
108
- "reason": "The hierarchy collapsed into interchangeable dashboard chrome.",
109
- "blocking": true
110
- }
111
- ],
112
- "findings": [
113
- {
114
- "area": "layout",
115
- "severity": "high",
116
- "problem": "The page uses balanced card grid without priority shift.",
117
- "evidence": "Every block carries equal weight and the CTA no longer leads.",
118
- "requiredAction": "Rebuild the page around one dominant task surface.",
119
- "blockingRecommended": true
120
- }
121
- ],
122
- "notes": [
123
- "Interchangeable dashboard chrome now dominates the flow."
124
- ],
125
- "tasteVsFailureSeparated": true,
126
- "expected": {
127
- "calibratedStatus": "generic",
128
- "contractDriftDetected": true
129
- }
130
- },
131
- {
132
- "id": "provider-overcalls-generic",
133
- "label": "Provider called the work generic, but the evidence points to valid authored moves",
134
- "designExecutionSummary": {
135
- "contractReady": true
136
- },
137
- "genericityAssessment": {
138
- "status": "generic",
139
- "reason": "The work feels generic, although it carries one clear signature move and distinct typographic hierarchy."
140
- },
141
- "rubricBreakdown": [
142
- {
143
- "dimension": "contractFidelity",
144
- "score": 82,
145
- "verdict": "strong",
146
- "reason": "Contract fidelity is strong and the task order remains deliberate.",
147
- "blocking": true
148
- }
149
- ],
150
- "findings": [],
151
- "notes": [
152
- "The surface uses one clear signature move with distinct typographic hierarchy and non template task priority."
153
- ],
154
- "tasteVsFailureSeparated": true,
155
- "expected": {
156
- "calibratedStatus": "distinctive",
157
- "contractDriftDetected": false
158
- }
159
- },
160
- {
161
- "id": "unnamed-genericity-claim",
162
- "label": "Genericity claim without named drift signal drops to unclear",
163
- "designExecutionSummary": {
164
- "contractReady": true
165
- },
166
- "genericityAssessment": {
167
- "status": "generic",
168
- "reason": "The layout still feels a little too safe and familiar."
169
- },
170
- "rubricBreakdown": [
171
- {
172
- "dimension": "contractFidelity",
173
- "score": 78,
174
- "verdict": "acceptable",
175
- "reason": "The contract is mostly intact.",
176
- "blocking": true
177
- }
178
- ],
179
- "findings": [],
180
- "notes": [],
181
- "tasteVsFailureSeparated": true,
182
- "expected": {
183
- "calibratedStatus": "unclear",
184
- "contractDriftDetected": false
185
- }
186
- }
187
- ]
188
- }