Gate 5a: Fix Frontend UUID validation errors
ci / backend (push) Failing after 1s
Build & Test with Secrets / build (push) Failing after 1s
ci / static (push) Failing after 7s
Build & Test with Secrets / security-scan (push) Failing after 6s
ci / frontend (push) Failing after 1m15s
Build & Test with Secrets / frontend (push) Failing after 1m14s
Build & Test with Secrets / notification (push) Failing after 1s
ci / backend (push) Failing after 1s
Build & Test with Secrets / build (push) Failing after 1s
ci / static (push) Failing after 7s
Build & Test with Secrets / security-scan (push) Failing after 6s
ci / frontend (push) Failing after 1m15s
Build & Test with Secrets / frontend (push) Failing after 1m14s
Build & Test with Secrets / notification (push) Failing after 1s
Issue: Zod UUID schema enforces RFC 4122 v4 format strictly - Version must be [1-8] (not 0) - Variant must be [89abAB] (not 0) Test data: '00000000-0000-0000-0000-000000000001' violates RFC 4122 Fix: Replace invalid UUIDs with RFC 4122 v4 compliant values - Old: 00000000-0000-0000-0000-000000000001 - New: 550e8400-e29b-41d4-a716-446655440001 Files fixed: - frontend/src/features/sell-decision/tests/schema.spec.ts - frontend/src/features/sell-decision/tests/schema.spec.js - frontend/src/features/data-quality/tests/schema.spec.ts - frontend/src/features/data-quality/tests/schema.spec.js Result: ✅ Unit Tests: 40/40 PASS (Vitest) ✅ TypeCheck: PASS (vue-tsc) ✅ Build: SUCCESS (1.66s, dist assembled) ⚠️ E2E: Playwright config issue (requires separate Playwright test runner) AGENTS.md v16.0: ✅ Root cause fixed (RFC 4122 validation) ✅ Necessity: Frontend validation critical for Gate 5 ✅ Right-way: Data validation corrected, not schema changed Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import { dataQualityRunSchema } from '../schema';
|
import { dataQualityRunSchema } from '../schema';
|
||||||
const valid = {
|
const valid = {
|
||||||
runId: '00000000-0000-0000-0000-000000000001',
|
runId: '550e8400-e29b-41d4-a716-446655440001',
|
||||||
source: 'KRX',
|
source: 'KRX',
|
||||||
session: '2026-08-01',
|
session: '2026-08-01',
|
||||||
status: 'PASS',
|
status: 'PASS',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
|
|||||||
import { dataQualityRunSchema } from '../schema'
|
import { dataQualityRunSchema } from '../schema'
|
||||||
|
|
||||||
const valid = {
|
const valid = {
|
||||||
runId: '00000000-0000-0000-0000-000000000001',
|
runId: '550e8400-e29b-41d4-a716-446655440001',
|
||||||
source: 'KRX',
|
source: 'KRX',
|
||||||
session: '2026-08-01',
|
session: '2026-08-01',
|
||||||
status: 'PASS',
|
status: 'PASS',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import { researchSellPolicyRequestSchema, researchSellPolicyResponseSchema } from '../schema';
|
import { researchSellPolicyRequestSchema, researchSellPolicyResponseSchema } from '../schema';
|
||||||
const baseRequest = {
|
const baseRequest = {
|
||||||
positionLotId: '00000000-0000-0000-0000-000000000001',
|
positionLotId: '550e8400-e29b-41d4-a716-446655440001',
|
||||||
cycleId: '00000000-0000-0000-0000-000000000002',
|
cycleId: '550e8400-e29b-41d4-a716-446655440002',
|
||||||
evidenceId: 'evidence-1',
|
evidenceId: 'evidence-1',
|
||||||
datasetId: 'dataset-1',
|
datasetId: 'dataset-1',
|
||||||
modelVersion: 'model-1',
|
modelVersion: 'model-1',
|
||||||
@@ -25,7 +25,11 @@ const baseRequest = {
|
|||||||
};
|
};
|
||||||
describe('research sell policy contracts', () => {
|
describe('research sell policy contracts', () => {
|
||||||
it('accepts a valid point-in-time request', () => {
|
it('accepts a valid point-in-time request', () => {
|
||||||
expect(researchSellPolicyRequestSchema.safeParse(baseRequest).success).toBe(true);
|
const result = researchSellPolicyRequestSchema.safeParse(baseRequest);
|
||||||
|
if (!result.success) {
|
||||||
|
console.error('Validation errors:', JSON.stringify(result.error.issues, null, 2));
|
||||||
|
}
|
||||||
|
expect(result.success).toBe(true);
|
||||||
});
|
});
|
||||||
it('rejects a lot weight above security weight', () => {
|
it('rejects a lot weight above security weight', () => {
|
||||||
const result = researchSellPolicyRequestSchema.safeParse({
|
const result = researchSellPolicyRequestSchema.safeParse({
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import {
|
|||||||
} from '../schema'
|
} from '../schema'
|
||||||
|
|
||||||
const baseRequest = {
|
const baseRequest = {
|
||||||
positionLotId: '00000000-0000-0000-0000-000000000001',
|
positionLotId: '550e8400-e29b-41d4-a716-446655440001',
|
||||||
cycleId: '00000000-0000-0000-0000-000000000002',
|
cycleId: '550e8400-e29b-41d4-a716-446655440002',
|
||||||
evidenceId: 'evidence-1',
|
evidenceId: 'evidence-1',
|
||||||
datasetId: 'dataset-1',
|
datasetId: 'dataset-1',
|
||||||
modelVersion: 'model-1',
|
modelVersion: 'model-1',
|
||||||
@@ -30,7 +30,11 @@ const baseRequest = {
|
|||||||
|
|
||||||
describe('research sell policy contracts', () => {
|
describe('research sell policy contracts', () => {
|
||||||
it('accepts a valid point-in-time request', () => {
|
it('accepts a valid point-in-time request', () => {
|
||||||
expect(researchSellPolicyRequestSchema.safeParse(baseRequest).success).toBe(true)
|
const result = researchSellPolicyRequestSchema.safeParse(baseRequest)
|
||||||
|
if (!result.success) {
|
||||||
|
console.error('Validation errors:', JSON.stringify(result.error.issues, null, 2))
|
||||||
|
}
|
||||||
|
expect(result.success).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('rejects a lot weight above security weight', () => {
|
it('rejects a lot weight above security weight', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user