@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.
- package/.agents/plugins/marketplace.json +21 -0
- package/.agents/rules/agentic-senior-core.md +126 -0
- package/.claude-plugin/marketplace.json +17 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.clinerules/agentic-senior-core.md +94 -0
- package/.codex-plugin/plugin.json +24 -0
- package/.cursor/rules/agentic-senior-core.mdc +99 -0
- package/.devin-plugin/plugin.json +13 -0
- package/.github/copilot-instructions.md +94 -0
- package/.github/plugin/marketplace.json +20 -0
- package/.github/plugin/plugin.json +16 -0
- package/.kiro/steering/agentic-senior-core.md +94 -0
- package/.openclaw/skills/asc/SKILL.md +23 -0
- package/.openclaw/skills/asc-audit/SKILL.md +28 -0
- package/.openclaw/skills/asc-review/SKILL.md +54 -0
- package/.opencode/plugins/agentic-senior-core.mjs +31 -0
- package/.windsurf/rules/agentic-senior-core.md +94 -0
- package/AGENTS.md +126 -179
- package/CONTRIBUTING.md +93 -63
- package/README.md +160 -111
- package/__init__.py +61 -0
- package/bin/agentic-senior-core.js +41 -43
- package/commands/asc-audit.md +1 -0
- package/commands/asc-audit.toml +2 -0
- package/commands/asc-help.md +9 -0
- package/commands/asc-help.toml +2 -0
- package/commands/asc-refactor.md +1 -0
- package/commands/asc-refactor.toml +2 -0
- package/commands/asc-review.md +1 -0
- package/commands/asc-review.toml +2 -0
- package/gemini-extension.json +10 -0
- package/hooks/copilot-hooks.json +21 -0
- package/hooks/hooks.json +31 -0
- package/hooks/session-start.js +36 -0
- package/hooks/subagent-start.js +38 -0
- package/lib/cli/commands/adapter.mjs +109 -0
- package/lib/cli/commands/clean.mjs +63 -0
- package/lib/cli/commands/status.mjs +94 -0
- package/package.json +43 -67
- package/plugin.yaml +16 -0
- package/scripts/uninstall.js +38 -0
- package/skills/asc/SKILL.md +16 -0
- package/skills/asc-audit/SKILL.md +28 -0
- package/skills/asc-refactor/SKILL.md +35 -0
- package/skills/asc-review/SKILL.md +54 -0
- package/.agent-context/policies/llm-judge-threshold.json +0 -29
- package/.agent-context/prompts/bootstrap-design.md +0 -63
- package/.agent-context/prompts/compact-natural-mode.md +0 -100
- package/.agent-context/prompts/init-project.md +0 -60
- package/.agent-context/prompts/refactor.md +0 -38
- package/.agent-context/prompts/review-code.md +0 -31
- package/.agent-context/review-checklists/architecture-review.md +0 -57
- package/.agent-context/review-checklists/pr-checklist.md +0 -136
- package/.agent-context/rules/api-docs.md +0 -24
- package/.agent-context/rules/api-versioning.md +0 -16
- package/.agent-context/rules/architecture.md +0 -33
- package/.agent-context/rules/background-jobs.md +0 -17
- package/.agent-context/rules/config-and-flags.md +0 -16
- package/.agent-context/rules/database-design.md +0 -18
- package/.agent-context/rules/docker-runtime.md +0 -17
- package/.agent-context/rules/error-handling.md +0 -16
- package/.agent-context/rules/event-driven.md +0 -16
- package/.agent-context/rules/frontend-architecture.md +0 -54
- package/.agent-context/rules/microservices.md +0 -16
- package/.agent-context/rules/migrations.md +0 -16
- package/.agent-context/rules/observability.md +0 -16
- package/.agent-context/rules/performance.md +0 -16
- package/.agent-context/rules/realtime.md +0 -16
- package/.agent-context/rules/resilience.md +0 -18
- package/.agent-context/rules/security.md +0 -18
- package/.agent-context/rules/testing.md +0 -16
- package/.agent-context/state/README.md +0 -25
- package/.agent-context/state/architecture-map.md +0 -40
- package/.agent-context/state/benchmark-comparison-schema.json +0 -181
- package/.agent-context/state/benchmark-reproducibility.json +0 -87
- package/.agent-context/state/benchmark-thresholds.json +0 -10
- package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
- package/.agent-context/state/dependency-map.md +0 -41
- package/.agent-context/state/memory-adapter-contract.json +0 -52
- package/.agent-context/state/memory-schema-v1.json +0 -88
- package/GEMINI.md +0 -1
- package/benchmarks/README.md +0 -60
- package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
- package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
- package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
- package/lib/cli/adaptive-context/catalog.mjs +0 -390
- package/lib/cli/adaptive-context/file-signals.mjs +0 -100
- package/lib/cli/adaptive-context/implications.mjs +0 -44
- package/lib/cli/adaptive-context.mjs +0 -365
- package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
- package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
- package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
- package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
- package/lib/cli/backup.mjs +0 -210
- package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
- package/lib/cli/commands/context.mjs +0 -140
- package/lib/cli/commands/init/project-context.mjs +0 -60
- package/lib/cli/commands/init/runtime-environment.mjs +0 -59
- package/lib/cli/commands/init/setup-decisions.mjs +0 -83
- package/lib/cli/commands/init.mjs +0 -654
- package/lib/cli/commands/launch.mjs +0 -76
- package/lib/cli/commands/optimize.mjs +0 -284
- package/lib/cli/commands/rollback.mjs +0 -64
- package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
- package/lib/cli/commands/upgrade.mjs +0 -451
- package/lib/cli/compiler.mjs +0 -570
- package/lib/cli/constants.mjs +0 -136
- package/lib/cli/detector/constants.mjs +0 -135
- package/lib/cli/detector/design-evidence/collector.mjs +0 -256
- package/lib/cli/detector/design-evidence/constants.mjs +0 -39
- package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
- package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
- package/lib/cli/detector/design-evidence/summary.mjs +0 -109
- package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
- package/lib/cli/detector/design-evidence.mjs +0 -25
- package/lib/cli/detector/stack-detection.mjs +0 -243
- package/lib/cli/detector/ui-signals.mjs +0 -150
- package/lib/cli/detector/workspace-scan.mjs +0 -177
- package/lib/cli/detector.mjs +0 -23
- package/lib/cli/init-detection-flow.mjs +0 -48
- package/lib/cli/init-options.mjs +0 -237
- package/lib/cli/init-selection.mjs +0 -29
- package/lib/cli/memory-continuity.mjs +0 -537
- package/lib/cli/preflight.mjs +0 -76
- package/lib/cli/project-scaffolder/constants.mjs +0 -69
- package/lib/cli/project-scaffolder/discovery.mjs +0 -272
- package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
- package/lib/cli/project-scaffolder/storage.mjs +0 -144
- package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
- package/lib/cli/project-scaffolder.mjs +0 -29
- package/lib/cli/rollback.mjs +0 -66
- package/lib/cli/token-optimization.mjs +0 -486
- package/lib/cli/utils/filesystem.mjs +0 -81
- package/lib/cli/utils/managed-surface.mjs +0 -280
- package/lib/cli/utils/prompting.mjs +0 -44
- package/lib/cli/utils.mjs +0 -479
- package/mcp.json +0 -134
- package/scripts/adaptive-context/fixtures.mjs +0 -183
- package/scripts/adaptive-context-benchmark.mjs +0 -9
- package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
- package/scripts/audit-cache-layer-contract.mjs +0 -263
- package/scripts/audit-caching-scope-hygiene.mjs +0 -268
- package/scripts/audit-file-size.mjs +0 -219
- package/scripts/audit-reflection-citations.mjs +0 -163
- package/scripts/audit-release-bundle.mjs +0 -170
- package/scripts/audit-rule-id-uniqueness.mjs +0 -313
- package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
- package/scripts/benchmark-evidence-bundle.mjs +0 -645
- package/scripts/benchmark-gate.mjs +0 -121
- package/scripts/benchmark-intelligence.mjs +0 -33
- package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
- package/scripts/build-release-benchmark-bundle.mjs +0 -202
- package/scripts/bump-version.mjs +0 -103
- package/scripts/clean-local-artifacts.mjs +0 -78
- package/scripts/compact-natural-mode-benchmark.mjs +0 -9
- package/scripts/context-triggered-audit.mjs +0 -391
- package/scripts/detection-benchmark.mjs +0 -127
- package/scripts/docs-quality-drift-report.mjs +0 -358
- package/scripts/documentation-boundary-audit.mjs +0 -305
- package/scripts/explain-on-demand-audit.mjs +0 -427
- package/scripts/forbidden-content-check.mjs +0 -123
- package/scripts/frontend-usability-audit.mjs +0 -243
- package/scripts/generate-sbom.mjs +0 -61
- package/scripts/governance-weekly-report.mjs +0 -466
- package/scripts/llm-judge/checklist-loader.mjs +0 -45
- package/scripts/llm-judge/constants.mjs +0 -66
- package/scripts/llm-judge/diff-collection.mjs +0 -74
- package/scripts/llm-judge/prompting.mjs +0 -78
- package/scripts/llm-judge/providers.mjs +0 -111
- package/scripts/llm-judge/verdict.mjs +0 -134
- package/scripts/llm-judge.mjs +0 -200
- package/scripts/memory-continuity-benchmark.mjs +0 -322
- package/scripts/quality-trend-report.mjs +0 -289
- package/scripts/release-gate/audit-checks.mjs +0 -441
- package/scripts/release-gate/constants.mjs +0 -53
- package/scripts/release-gate/runtime.mjs +0 -63
- package/scripts/release-gate/static-checks.mjs +0 -182
- package/scripts/release-gate.mjs +0 -42
- package/scripts/rules-guardian-audit.mjs +0 -580
- package/scripts/single-source-lazy-loading-audit.mjs +0 -449
- package/scripts/sync-thin-adapters.mjs +0 -72
- package/scripts/token-optimization-benchmark.mjs +0 -252
- package/scripts/ui-design-judge/constants.mjs +0 -13
- package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
- package/scripts/ui-design-judge/git-input.mjs +0 -134
- package/scripts/ui-design-judge/prompting.mjs +0 -52
- package/scripts/ui-design-judge/providers.mjs +0 -102
- package/scripts/ui-design-judge/reporting.mjs +0 -183
- package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
- package/scripts/ui-design-judge/rubric-goldset.json +0 -188
- package/scripts/ui-design-judge.mjs +0 -319
- package/scripts/ui-rubric-calibration.mjs +0 -35
- package/scripts/validate/config.mjs +0 -519
- package/scripts/validate/coverage-checks.mjs +0 -446
- package/scripts/validate/file-structure.mjs +0 -162
- package/scripts/validate/markdown-content.mjs +0 -109
- package/scripts/validate/project-metadata.mjs +0 -166
- package/scripts/validate.mjs +0 -338
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-check
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ui-design-judge.mjs
|
|
6
|
-
*
|
|
7
|
-
* Advisory-default UI design contract judge.
|
|
8
|
-
*
|
|
9
|
-
* Repo-internal workflow audit; no user-facing runtime modes.
|
|
10
|
-
* Stays advisory when no provider is configured or no auto-fail signal is found.
|
|
11
|
-
* reviewRubric.genericityAutoFail escalates named drift signals and forbidden
|
|
12
|
-
* patterns into blocking findings and blocking required actions when provider
|
|
13
|
-
* evidence is available.
|
|
14
|
-
*
|
|
15
|
-
* Validation anchors for repo governance:
|
|
16
|
-
* - Do not reward generic SaaS defaults or popular template patterns.
|
|
17
|
-
* - UI design judge only evaluates changed UI surfaces.
|
|
18
|
-
* - Structured design execution summary was supplied to semantic review.
|
|
19
|
-
* - designExecutionSignalCount
|
|
20
|
-
* - designExecutionPolicy
|
|
21
|
-
* - designExecutionHandoff
|
|
22
|
-
* - handoffReady
|
|
23
|
-
* - structuredInspectionAvailable
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import { collectChangedFiles, collectPullRequestDiff, isUiRelevantFilePath } from './ui-design-judge/git-input.mjs';
|
|
27
|
-
import { buildSystemPrompt, buildUserMessage } from './ui-design-judge/prompting.mjs';
|
|
28
|
-
import { selectAvailableProvider } from './ui-design-judge/providers.mjs';
|
|
29
|
-
import { calibrateGenericityAssessment } from './ui-design-judge/rubric-calibration.mjs';
|
|
30
|
-
import {
|
|
31
|
-
buildReport,
|
|
32
|
-
emitMachineReadableReport,
|
|
33
|
-
extractVerdictObject,
|
|
34
|
-
normalizeFindings,
|
|
35
|
-
normalizeGenericityAssessment,
|
|
36
|
-
normalizeRubricBreakdown,
|
|
37
|
-
} from './ui-design-judge/reporting.mjs';
|
|
38
|
-
import { loadDesignGuide, loadDesignIntent, summarizeDesignExecutionPolicy, summarizeReviewRubric } from './ui-design-judge/design-execution-summary.mjs';
|
|
39
|
-
|
|
40
|
-
function applyGenericityAutoFail({
|
|
41
|
-
reviewRubricSummary,
|
|
42
|
-
calibration,
|
|
43
|
-
findings,
|
|
44
|
-
notes,
|
|
45
|
-
}) {
|
|
46
|
-
const autoFailEnabled = reviewRubricSummary?.genericityAutoFail === true;
|
|
47
|
-
const namedGenericityDetected = Array.isArray(calibration?.matchedGenericitySignals)
|
|
48
|
-
&& calibration.matchedGenericitySignals.length > 0;
|
|
49
|
-
const forbiddenPatternDetected = Array.isArray(calibration?.matchedForbiddenPatterns)
|
|
50
|
-
&& calibration.matchedForbiddenPatterns.length > 0;
|
|
51
|
-
const shouldAutoFail = autoFailEnabled
|
|
52
|
-
&& calibration?.calibratedStatus === 'generic'
|
|
53
|
-
&& (namedGenericityDetected || forbiddenPatternDetected);
|
|
54
|
-
|
|
55
|
-
if (!shouldAutoFail) {
|
|
56
|
-
return {
|
|
57
|
-
findings,
|
|
58
|
-
notes,
|
|
59
|
-
autoFailTriggered: false,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const normalizedFindings = Array.isArray(findings) ? findings.map((finding) => ({ ...finding })) : [];
|
|
64
|
-
const updatedFindings = normalizedFindings.length > 0
|
|
65
|
-
? normalizedFindings.map((finding) => ({
|
|
66
|
-
...finding,
|
|
67
|
-
blockingRecommended: true,
|
|
68
|
-
}))
|
|
69
|
-
: [
|
|
70
|
-
{
|
|
71
|
-
area: 'design-contract',
|
|
72
|
-
severity: 'high',
|
|
73
|
-
problem: 'The UI matches named genericity drift signals that the contract marks as auto-fail.',
|
|
74
|
-
evidence: `Matched signals: ${[...(calibration.matchedGenericitySignals || []), ...(calibration.matchedForbiddenPatterns || [])].join(', ')}`,
|
|
75
|
-
requiredAction: 'Rebuild the affected UI surfaces from the contract and remove the named generic patterns instead of polishing them.',
|
|
76
|
-
blockingRecommended: true,
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
findings: updatedFindings,
|
|
82
|
-
notes: [
|
|
83
|
-
...(Array.isArray(notes) ? notes : []),
|
|
84
|
-
'reviewRubric.genericityAutoFail triggered because named genericity drift signals or forbidden patterns were detected.',
|
|
85
|
-
],
|
|
86
|
-
autoFailTriggered: true,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function main() {
|
|
91
|
-
const changedFiles = collectChangedFiles();
|
|
92
|
-
const changedUiFiles = changedFiles.filter(isUiRelevantFilePath);
|
|
93
|
-
const rawDiff = collectPullRequestDiff();
|
|
94
|
-
const designIntentContent = loadDesignIntent();
|
|
95
|
-
const designGuideContent = loadDesignGuide();
|
|
96
|
-
|
|
97
|
-
if (!designGuideContent.trim()) {
|
|
98
|
-
emitMachineReadableReport(buildReport({
|
|
99
|
-
skipped: true,
|
|
100
|
-
skipReason: 'Design guide is missing or unreadable. Skipping UI design judge.',
|
|
101
|
-
contractPresent: false,
|
|
102
|
-
notes: ['docs/DESIGN.md is required for contract-aware UI judging.'],
|
|
103
|
-
}));
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (changedUiFiles.length === 0) {
|
|
108
|
-
emitMachineReadableReport(buildReport({
|
|
109
|
-
skipped: true,
|
|
110
|
-
skipReason: 'No UI-relevant changed files detected.',
|
|
111
|
-
contractPresent: true,
|
|
112
|
-
summary: {
|
|
113
|
-
changedUiFileCount: 0,
|
|
114
|
-
alignmentScore: null,
|
|
115
|
-
driftCount: 0,
|
|
116
|
-
blockingCandidateCount: 0,
|
|
117
|
-
designExecutionSignalCount: 0,
|
|
118
|
-
genericityStatus: 'unclear',
|
|
119
|
-
},
|
|
120
|
-
notes: ['UI design judge only evaluates changed UI surfaces.'],
|
|
121
|
-
}));
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const designExecutionSummary = summarizeDesignExecutionPolicy(designIntentContent || {});
|
|
126
|
-
const reviewRubricSummary = summarizeReviewRubric(designIntentContent || {});
|
|
127
|
-
|
|
128
|
-
const systemPrompt = buildSystemPrompt();
|
|
129
|
-
const userMessage = buildUserMessage(
|
|
130
|
-
designIntentContent,
|
|
131
|
-
designGuideContent,
|
|
132
|
-
rawDiff,
|
|
133
|
-
changedUiFiles,
|
|
134
|
-
designExecutionSummary
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const selectedProvider = selectAvailableProvider();
|
|
138
|
-
if (!selectedProvider) {
|
|
139
|
-
const calibration = calibrateGenericityAssessment({
|
|
140
|
-
reviewRubricSummary,
|
|
141
|
-
designExecutionSummary,
|
|
142
|
-
genericityAssessment: { status: 'unclear', reason: 'No provider review was run.' },
|
|
143
|
-
rubricBreakdown: [],
|
|
144
|
-
findings: [],
|
|
145
|
-
notes: [],
|
|
146
|
-
tasteVsFailureSeparated: null,
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
emitMachineReadableReport(buildReport({
|
|
150
|
-
provider: 'none',
|
|
151
|
-
contractPresent: true,
|
|
152
|
-
summary: {
|
|
153
|
-
changedUiFileCount: changedUiFiles.length,
|
|
154
|
-
alignmentScore: null,
|
|
155
|
-
driftCount: 0,
|
|
156
|
-
blockingCandidateCount: 0,
|
|
157
|
-
designExecutionSignalCount: designExecutionSummary.enabledCapabilities.length,
|
|
158
|
-
structuredInspectionAvailable: designExecutionSummary.structuredInspectionAvailable,
|
|
159
|
-
genericityStatus: calibration.calibratedStatus,
|
|
160
|
-
},
|
|
161
|
-
designExecution: designExecutionSummary,
|
|
162
|
-
rubric: {
|
|
163
|
-
expectedDimensions: reviewRubricSummary.dimensions.map((dimension) => dimension.key),
|
|
164
|
-
breakdown: [],
|
|
165
|
-
genericityAssessment: {
|
|
166
|
-
status: 'unclear',
|
|
167
|
-
reason: 'No provider review was run.',
|
|
168
|
-
},
|
|
169
|
-
tasteVsFailureSeparated: null,
|
|
170
|
-
calibration,
|
|
171
|
-
},
|
|
172
|
-
semanticJudge: {
|
|
173
|
-
attempted: false,
|
|
174
|
-
skipped: true,
|
|
175
|
-
skipReason: 'no-provider-configured',
|
|
176
|
-
},
|
|
177
|
-
notes: [
|
|
178
|
-
'No LLM provider configured. UI design judge skipped provider review and stayed advisory.',
|
|
179
|
-
...designExecutionSummary.notes,
|
|
180
|
-
],
|
|
181
|
-
}));
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
let rawJudgeResponse;
|
|
186
|
-
try {
|
|
187
|
-
rawJudgeResponse = await selectedProvider.invokeProvider(systemPrompt, userMessage);
|
|
188
|
-
} catch (providerError) {
|
|
189
|
-
const calibration = calibrateGenericityAssessment({
|
|
190
|
-
reviewRubricSummary,
|
|
191
|
-
designExecutionSummary,
|
|
192
|
-
genericityAssessment: { status: 'unclear', reason: 'Provider review failed before rubric scoring completed.' },
|
|
193
|
-
rubricBreakdown: [],
|
|
194
|
-
findings: [],
|
|
195
|
-
notes: [],
|
|
196
|
-
tasteVsFailureSeparated: null,
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
const providerErrorMessage = providerError instanceof Error
|
|
200
|
-
? providerError.message
|
|
201
|
-
: 'Unknown provider error';
|
|
202
|
-
|
|
203
|
-
emitMachineReadableReport(buildReport({
|
|
204
|
-
provider: selectedProvider.providerName,
|
|
205
|
-
contractPresent: true,
|
|
206
|
-
providerError: true,
|
|
207
|
-
summary: {
|
|
208
|
-
changedUiFileCount: changedUiFiles.length,
|
|
209
|
-
alignmentScore: null,
|
|
210
|
-
driftCount: 0,
|
|
211
|
-
blockingCandidateCount: 0,
|
|
212
|
-
designExecutionSignalCount: designExecutionSummary.enabledCapabilities.length,
|
|
213
|
-
structuredInspectionAvailable: designExecutionSummary.structuredInspectionAvailable,
|
|
214
|
-
genericityStatus: calibration.calibratedStatus,
|
|
215
|
-
},
|
|
216
|
-
designExecution: designExecutionSummary,
|
|
217
|
-
rubric: {
|
|
218
|
-
expectedDimensions: reviewRubricSummary.dimensions.map((dimension) => dimension.key),
|
|
219
|
-
breakdown: [],
|
|
220
|
-
genericityAssessment: {
|
|
221
|
-
status: 'unclear',
|
|
222
|
-
reason: 'Provider review failed before rubric scoring completed.',
|
|
223
|
-
},
|
|
224
|
-
tasteVsFailureSeparated: null,
|
|
225
|
-
calibration,
|
|
226
|
-
},
|
|
227
|
-
semanticJudge: {
|
|
228
|
-
attempted: true,
|
|
229
|
-
skipped: false,
|
|
230
|
-
skipReason: null,
|
|
231
|
-
},
|
|
232
|
-
notes: [`Provider call failed: ${providerErrorMessage}`, ...designExecutionSummary.notes],
|
|
233
|
-
passed: true,
|
|
234
|
-
}));
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const { verdict, malformed } = extractVerdictObject(rawJudgeResponse);
|
|
239
|
-
const findings = normalizeFindings(verdict?.findings);
|
|
240
|
-
const rubricBreakdown = normalizeRubricBreakdown(
|
|
241
|
-
verdict?.rubricBreakdown,
|
|
242
|
-
reviewRubricSummary.dimensions.map((dimension) => dimension.key)
|
|
243
|
-
);
|
|
244
|
-
const genericityAssessment = normalizeGenericityAssessment(verdict?.genericityAssessment);
|
|
245
|
-
const tasteVsFailureSeparated = typeof verdict?.tasteVsFailureSeparated === 'boolean'
|
|
246
|
-
? verdict.tasteVsFailureSeparated
|
|
247
|
-
: null;
|
|
248
|
-
const alignmentScore = typeof verdict?.alignmentScore === 'number' ? verdict.alignmentScore : null;
|
|
249
|
-
const notes = Array.isArray(verdict?.notes)
|
|
250
|
-
? verdict.notes.map((note) => String(note))
|
|
251
|
-
: [];
|
|
252
|
-
const calibration = calibrateGenericityAssessment({
|
|
253
|
-
reviewRubricSummary,
|
|
254
|
-
designExecutionSummary,
|
|
255
|
-
genericityAssessment,
|
|
256
|
-
rubricBreakdown,
|
|
257
|
-
findings,
|
|
258
|
-
notes,
|
|
259
|
-
tasteVsFailureSeparated,
|
|
260
|
-
});
|
|
261
|
-
const autoFailResolution = applyGenericityAutoFail({
|
|
262
|
-
reviewRubricSummary,
|
|
263
|
-
calibration,
|
|
264
|
-
findings,
|
|
265
|
-
notes,
|
|
266
|
-
});
|
|
267
|
-
const resolvedFindings = autoFailResolution.findings;
|
|
268
|
-
const resolvedNotes = autoFailResolution.notes;
|
|
269
|
-
const blockingCandidateCount = resolvedFindings.filter((finding) => finding.blockingRecommended || finding.severity === 'high').length;
|
|
270
|
-
|
|
271
|
-
emitMachineReadableReport(buildReport({
|
|
272
|
-
provider: selectedProvider.providerName,
|
|
273
|
-
contractPresent: true,
|
|
274
|
-
mode: autoFailResolution.autoFailTriggered ? 'blocking-recommended' : 'advisory',
|
|
275
|
-
advisoryOnly: !autoFailResolution.autoFailTriggered,
|
|
276
|
-
passed: !autoFailResolution.autoFailTriggered,
|
|
277
|
-
autoFailTriggered: autoFailResolution.autoFailTriggered,
|
|
278
|
-
malformedVerdict: malformed,
|
|
279
|
-
summary: {
|
|
280
|
-
changedUiFileCount: changedUiFiles.length,
|
|
281
|
-
alignmentScore,
|
|
282
|
-
driftCount: resolvedFindings.length,
|
|
283
|
-
blockingCandidateCount,
|
|
284
|
-
designExecutionSignalCount: designExecutionSummary.enabledCapabilities.length,
|
|
285
|
-
structuredInspectionAvailable: designExecutionSummary.structuredInspectionAvailable,
|
|
286
|
-
genericityStatus: calibration.calibratedStatus,
|
|
287
|
-
},
|
|
288
|
-
designExecution: designExecutionSummary,
|
|
289
|
-
rubric: {
|
|
290
|
-
expectedDimensions: reviewRubricSummary.dimensions.map((dimension) => dimension.key),
|
|
291
|
-
breakdown: rubricBreakdown,
|
|
292
|
-
genericityAssessment,
|
|
293
|
-
tasteVsFailureSeparated,
|
|
294
|
-
calibration,
|
|
295
|
-
},
|
|
296
|
-
semanticJudge: {
|
|
297
|
-
attempted: true,
|
|
298
|
-
skipped: false,
|
|
299
|
-
skipReason: null,
|
|
300
|
-
},
|
|
301
|
-
findings: resolvedFindings,
|
|
302
|
-
notes: malformed
|
|
303
|
-
? ['LLM response was malformed. Advisory mode kept the audit non-blocking.', ...designExecutionSummary.notes]
|
|
304
|
-
: [...resolvedNotes, ...calibration.notes, ...designExecutionSummary.notes],
|
|
305
|
-
}));
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
main().catch((unexpectedError) => {
|
|
309
|
-
const errorMessage = unexpectedError instanceof Error
|
|
310
|
-
? unexpectedError.message
|
|
311
|
-
: 'Unknown unexpected error';
|
|
312
|
-
|
|
313
|
-
emitMachineReadableReport(buildReport({
|
|
314
|
-
provider: 'none',
|
|
315
|
-
providerError: true,
|
|
316
|
-
passed: true,
|
|
317
|
-
notes: [`Unexpected ui-design-judge failure: ${errorMessage}`],
|
|
318
|
-
}));
|
|
319
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// @ts-check
|
|
3
|
-
|
|
4
|
-
import { readFileSync } from 'node:fs';
|
|
5
|
-
import { dirname, resolve } from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { buildRubricCalibrationReport } from './ui-design-judge/rubric-calibration.mjs';
|
|
8
|
-
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
const GOLDSET_PATH = resolve(__dirname, 'ui-design-judge', 'rubric-goldset.json');
|
|
12
|
-
const REPORT_NAME = 'ui-rubric-calibration';
|
|
13
|
-
|
|
14
|
-
function loadGoldset() {
|
|
15
|
-
return JSON.parse(readFileSync(GOLDSET_PATH, 'utf8'));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function main() {
|
|
19
|
-
const goldset = loadGoldset();
|
|
20
|
-
const report = buildRubricCalibrationReport({
|
|
21
|
-
cases: goldset.cases,
|
|
22
|
-
reviewRubricSummary: goldset.reviewRubric,
|
|
23
|
-
});
|
|
24
|
-
report.reportName = REPORT_NAME;
|
|
25
|
-
// Keep the report surface explicit so static validation can detect the machine-readable payload contract.
|
|
26
|
-
report.accuracyPercent = report.accuracyPercent;
|
|
27
|
-
|
|
28
|
-
console.log(JSON.stringify(report, null, 2));
|
|
29
|
-
|
|
30
|
-
if (!report.passed) {
|
|
31
|
-
process.exitCode = 1;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
main();
|