--
--






--
-- Name: project_steps; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.project_steps (
    id integer NOT NULL,
    project_id text NOT NULL,
    step_number integer NOT NULL,
    step_name text NOT NULL,
    status text DEFAULT 'pending'::text,
    started_at timestamp without time zone,
    completed_at timestamp without time zone,
    metadata jsonb DEFAULT '{}'::jsonb
);


--
-- Name: project_steps_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

ALTER TABLE public.project_steps ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.project_steps_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- Name: projects; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.projects (
    id text NOT NULL,
    name text NOT NULL,
    description text,
    status text DEFAULT 'draft'::text,
    repo_url text,
    source_language text,
    target_language text,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now(),
    completed_at timestamp without time zone,
    total_files integer DEFAULT 0,
    total_lines integer DEFAULT 0,
    converted_files integer DEFAULT 0,
    accuracy real DEFAULT 0,
    test_coverage real DEFAULT 0,
    risk_score real DEFAULT 0,
    estimated_time text,
    elapsed_time text,
    team jsonb DEFAULT '[]'::jsonb,
    tags jsonb DEFAULT '[]'::jsonb,
    activity jsonb DEFAULT '[]'::jsonb,
    max_reached_step integer DEFAULT 0,
    current_step integer DEFAULT 0,
    user_id text,
    config jsonb DEFAULT '{}'::jsonb
);


--
-- Name: session; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.session (
    id text NOT NULL,
    user_id text NOT NULL,
    expires_at timestamp without time zone NOT NULL,
    ip_address text,
    user_agent text,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);


--
-- Name: user; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public."user" (
    id text NOT NULL,
    email text NOT NULL,
    email_verified boolean DEFAULT false,
    name text,
    image text,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now()
);

--
-- Data for Name: project_steps; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.project_steps (id, project_id, step_number, step_name, status, started_at, completed_at, metadata) FROM stdin;
9	proj-secb-complete	1	Repository	completed	2026-04-11 22:49:54.548	2026-04-12 08:19:07.893	{}
10	proj-secb-complete	2	Pre-Analysis	completed	2026-04-11 22:49:57.063	2026-04-12 08:19:09.269	{}
11	proj-secb-complete	3	Migration	completed	2026-04-11 22:49:58.506	2026-04-12 08:19:10.167	{}
13	proj-secb-complete	5	Verification	completed	2026-04-11 22:50:00.281	2026-04-12 08:26:31.064	{}
14	proj-secb-complete	6	Artifacts	completed	2026-04-11 22:50:00.993	2026-04-12 08:47:04.563	{}
15	proj-secb-complete	7	Export	completed	2026-04-11 22:50:01.705	2026-04-12 08:47:40.899	{}
12	proj-secb-complete	4	Code Review	completed	2026-04-11 22:49:59.435	2026-04-12 09:37:19.507	{}
16	proj-quick-demo	1	Repository	completed	2026-04-12 08:48:12.716	2026-04-12 09:37:29.979	{}
23	proj-quick-demo	2	Pre-Analysis	completed	2026-04-12 09:37:34.111	\N	{}
25	proj-quick-demo	4	Code Review	completed	2026-04-12 09:37:56.152	\N	{}
24	proj-quick-demo	3	Migration	completed	2026-04-12 09:37:35.798	2026-04-12 09:38:02.031	{}
3	proj-mmkg	2	Pre-Analysis	completed	2026-04-11 21:30:41.988	2026-04-11 22:16:15.291	{}
7	proj-mmkg	5	Verification	completed	2026-04-11 22:35:29.189	2026-04-11 22:35:31.408	{}
6	proj-mmkg	6	Artifacts	completed	2026-04-11 22:35:27.221	2026-04-11 22:35:33.043	{}
4	proj-mmkg	1	Repository	completed	2026-04-11 21:30:42.642	2026-04-11 22:35:34.084	{}
8	proj-mmkg	7	Export	completed	2026-04-11 22:35:35.989	\N	{}
5	proj-mmkg	4	Code Review	completed	2026-04-11 22:02:59.037	2026-04-11 22:35:51.432	{}
2	proj-mmkg	3	Migration	completed	2026-04-11 21:30:35.941	2026-04-11 22:35:51.899	{}
28	proj-j74x	1	Repository	completed	2026-04-12 10:31:51.034	\N	{}
29	proj-j74x	2	Pre-Analysis	completed	2026-04-12 10:31:54.847	\N	{}
27	proj-j74x	3	Migration	completed	2026-04-12 10:31:44.261	2026-04-12 10:32:02.568	{}
30	proj-uu4l	3	Migration	completed	2026-04-13 15:08:23.78	\N	{}
20	proj-demo-full	4	Code Review	completed	2026-04-12 09:37:11.738	2026-04-13 15:16:20.566	{}
21	proj-demo-full	5	Verification	completed	2026-04-12 09:37:14.008	2026-04-13 15:16:55.249	{}
22	proj-demo-full	6	Artifacts	completed	2026-04-12 09:37:14.774	2026-04-13 15:17:49.783	{}
26	proj-demo-full	7	Export	completed	2026-04-12 10:12:20.668	2026-04-13 15:18:08.885	{}
18	proj-demo-full	2	Pre-Analysis	completed	2026-04-12 09:37:08.545	2026-04-14 08:38:44.397	{}
17	proj-demo-full	1	Repository	completed	2026-04-12 09:37:06.988	2026-04-14 08:38:45.314	{}
19	proj-demo-full	3	Migration	completed	2026-04-12 09:37:09.626	2026-04-14 08:38:45.844	{}
\.


--
-- Data for Name: projects; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.projects (id, name, description, status, repo_url, source_language, target_language, created_at, updated_at, completed_at, total_files, total_lines, converted_files, accuracy, test_coverage, risk_score, estimated_time, elapsed_time, team, tags, activity, max_reached_step, current_step, user_id, config) FROM stdin;
proj-quick-demo	Quick Demo — Hello Banking	Live demo: COBOL-85 banking inquiry program → Java Spring Boot. Single file, ~60s migration with real AI translation.	analyzing	https://github.com/scriba-ai-dev/test-cobol	COBOL-85	Java 22	2026-04-12 00:35:15.212791	2026-04-12 09:57:30.369	\N	17	1972	0	0	0	32.5	\N	\N	[{"name": "Michele Laurelli", "role": "Project Lead", "avatar": "ML"}]	["demo", "cobol", "java", "live", "banking"]	[{"id": "act-1775986682037", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T09:38:02.037Z"}, {"id": "act-1775986676155", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-12T09:37:56.155Z"}, {"id": "act-1775986655801", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T09:37:35.801Z"}, {"id": "act-1775986654114", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-12T09:37:34.114Z"}, {"id": "act-1775986649981", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-12T09:37:29.981Z"}, {"id": "act-3", "user": "Scriba Engine", "action": "Pre-analysis completed — 9 source files, avg complexity 12", "timestamp": "2026-04-12T10:10:00Z"}, {"id": "act-2", "user": "Michele Laurelli", "action": "Repository connected — github.com/scriba-ai-dev/test-cobol", "timestamp": "2026-04-12T10:05:00Z"}, {"id": "act-1", "user": "Michele Laurelli", "action": "Project created", "timestamp": "2026-04-12T10:00:00Z"}]	3	3	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"branch": "main", "riskLevel": "low", "testMerge": null, "sourcePath": "/Users/michelelaurelli/Desktop/scribademo/scriba-demo/demo-source", "preAnalysis": {"risk": {"low": 3, "high": 4, "files": [{"name": "ACCTPROC.cbl", "path": "src/ACCTPROC.cbl", "risk": "high", "size": 10333, "lines": 290, "nesting": 12, "codeLines": 227, "complexity": 27, "procedures": 6, "dependencies": 3}, {"name": "ACCTBAL.cbl", "path": "src/ACCTBAL.cbl", "risk": "high", "size": 9444, "lines": 268, "nesting": 10, "codeLines": 206, "complexity": 20, "procedures": 7, "dependencies": 2}, {"name": "ACCTMAIN.cbl", "path": "src/ACCTMAIN.cbl", "risk": "high", "size": 8967, "lines": 241, "nesting": 8, "codeLines": 180, "complexity": 19, "procedures": 9, "dependencies": 6}, {"name": "ACCTOPEN.cbl", "path": "src/ACCTOPEN.cbl", "risk": "high", "size": 10976, "lines": 308, "nesting": 8, "codeLines": 243, "complexity": 16, "procedures": 8, "dependencies": 2}, {"name": "ACCTREPT.cbl", "path": "src/ACCTREPT.cbl", "risk": "medium", "size": 15200, "lines": 389, "nesting": 5, "codeLines": 308, "complexity": 13, "procedures": 15, "dependencies": 3}, {"name": "ACCTCLSE.cbl", "path": "src/ACCTCLSE.cbl", "risk": "medium", "size": 10856, "lines": 290, "nesting": 5, "codeLines": 224, "complexity": 10, "procedures": 11, "dependencies": 2}, {"name": "ACCTCOMN.cpy", "path": "cpy/ACCTCOMN.cpy", "risk": "low", "size": 3648, "lines": 53, "nesting": 0, "codeLines": 25, "complexity": 1, "procedures": 1, "dependencies": 0}, {"name": "ACCTMASTR.cpy", "path": "cpy/ACCTMASTR.cpy", "risk": "low", "size": 3892, "lines": 56, "nesting": 0, "codeLines": 30, "complexity": 1, "procedures": 1, "dependencies": 0}, {"name": "MOVRECORD.cpy", "path": "cpy/MOVRECORD.cpy", "risk": "low", "size": 5383, "lines": 77, "nesting": 0, "codeLines": 45, "complexity": 1, "procedures": 2, "dependencies": 0}], "medium": 2}, "complexity": {"avgLines": 219, "maxLines": 389, "avgNesting": 5.3, "maxNesting": 12, "avgCyclomatic": 12, "maxCyclomatic": 27, "totalSections": 78, "totalProcedures": 60}, "scanResults": {"languages": [{"name": "COBOL", "bytes": 78699, "files": 9, "percentage": 86.5}, {"name": "JCL", "bytes": 12249, "files": 3, "percentage": 13.5}], "totalSize": 110583, "extensions": [{"ext": ".cbl", "count": 6, "percentage": 35.3}, {"ext": ".cpy", "count": 3, "percentage": 17.6}, {"ext": ".txt", "count": 3, "percentage": 17.6}, {"ext": ".jcl", "count": 3, "percentage": 17.6}, {"ext": ".gitignore", "count": 1, "percentage": 5.9}, {"ext": ".md", "count": 1, "percentage": 5.9}], "totalFiles": 17, "totalLines": 1972, "totalCodeLines": 1488, "totalBlankLines": 304, "totalDirectories": 5, "totalSourceFiles": 9, "totalCommentLines": 180}, "dependencies": {"list": ["ACCTMASTR", "ACCTCOMN", "WS-MOD-ACCTOPEN", "WS-MOD-ACCTPROC", "WS-MOD-ACCTBAL", "WS-MOD-ACCTREPT", "WS-MOD-ACCTCLSE", "MOVRECORD"], "total": 8, "copybooks": 8, "orphanFiles": 3, "circularDeps": 0, "externalCalls": 0}, "analyzedFileCount": 9}, "businessUnit": "Demo", "projectOwner": "Algoretico", "maxIterations": 1, "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "targetAccuracy": 80, "namingConvention": "camelCase", "selectedDatabase": "postgresql", "selectedPriority": "low", "testingFramework": "junit5", "enableSecurityScan": true, "selectedCompliance": ["gdpr"], "architecturePattern": "layered", "confidenceThreshold": 90, "translationStrategy": "semantic", "preserveBusinessLogic": true}
proj-mmkg	Progetto Test Cobol to Java 	Progetto Test Cobol to Java	converting	https://github.com/scriba-ai-dev/test-cobol	cobol	java	2026-04-11 23:30:33.326697	2026-04-11 22:35:55.045	\N	0	0	0	0	0	0	\N	\N	[]	["banking"]	[{"id": "act-1775946951901", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:35:51.901Z"}, {"id": "act-1775946951435", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-11T22:35:51.435Z"}, {"id": "act-1775946935992", "user": "System", "action": "Completed Export", "timestamp": "2026-04-11T22:35:35.992Z"}, {"id": "act-1775946934087", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T22:35:34.087Z"}, {"id": "act-1775946933046", "user": "System", "action": "Completed Artifacts", "timestamp": "2026-04-11T22:35:33.046Z"}, {"id": "act-1775946931412", "user": "System", "action": "Completed Verification", "timestamp": "2026-04-11T22:35:31.412Z"}, {"id": "act-1775946930534", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-11T22:35:30.534Z"}, {"id": "act-1775946929191", "user": "System", "action": "Completed Verification", "timestamp": "2026-04-11T22:35:29.191Z"}, {"id": "act-1775946927226", "user": "System", "action": "Completed Artifacts", "timestamp": "2026-04-11T22:35:27.226Z"}, {"id": "act-1775946919473", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-11T22:35:19.473Z"}, {"id": "act-1775945776094", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:16:16.094Z"}, {"id": "act-1775945775294", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:16:15.294Z"}, {"id": "act-1775945774421", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:16:14.421Z"}, {"id": "act-1775945759822", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:15:59.822Z"}, {"id": "act-1775945425392", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:10:25.392Z"}, {"id": "act-1775945423809", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:10:23.809Z"}, {"id": "act-1775945349920", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:09:09.920Z"}, {"id": "act-1775945344001", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T22:09:04.001Z"}, {"id": "act-1775945340710", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:09:00.710Z"}, {"id": "act-1775944984229", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T22:03:04.229Z"}, {"id": "act-1775944983592", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:03:03.592Z"}, {"id": "act-1775944982250", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:03:02.250Z"}, {"id": "act-1775944981283", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:03:01.283Z"}, {"id": "act-1775944980142", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:03:00.142Z"}, {"id": "act-1775944979040", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-11T22:02:59.040Z"}, {"id": "act-1775944978514", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T22:02:58.514Z"}, {"id": "act-1775944977995", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:02:57.995Z"}, {"id": "act-1775944974432", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T22:02:54.432Z"}, {"id": "act-1775944971422", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:02:51.422Z"}, {"id": "act-1775944969377", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T22:02:49.377Z"}, {"id": "act-1775944968518", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T22:02:48.518Z"}, {"id": "act-1775944756241", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T21:59:16.241Z"}, {"id": "act-1775943380478", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T21:36:20.478Z"}, {"id": "act-1775943233441", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T21:33:53.441Z"}, {"id": "act-1775943232398", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T21:33:52.398Z"}, {"id": "act-1775943230700", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T21:33:50.700Z"}, {"id": "act-1775943042646", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-11T21:30:42.646Z"}, {"id": "act-1775943041991", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-11T21:30:41.991Z"}, {"id": "act-1775943035945", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-11T21:30:35.945Z"}, {"id": "act-1775943033325", "user": "System", "action": "Project created", "timestamp": "2026-04-11T21:30:33.325Z"}]	3	0	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"addCI": true, "branch": "main", "sshKey": "", "addDocs": true, "addTests": true, "deadline": "2026-04-24", "drRegion": "us-west-2", "encoding": "EBCDIC", "addDocker": true, "addLinter": true, "buildTool": "npm", "codeStyle": "standard", "dbStorage": "100", "dbVersion": "15", "enableELK": true, "enableIAM": true, "iamPolicy": "least-privilege", "riskLevel": "high", "authMethod": "Personal Access Token", "enableDAST": false, "enableSAST": true, "selectedCI": "github", "targetArch": "", "customRules": "", "projectCode": "Test-001", "targetBuild": "", "addFormatter": true, "apiFramework": "express", "businessUnit": "Dev ", "enableBackup": true, "enableJaeger": true, "estimatedLOC": "500", "legacySystem": "Test Cobol ", "preserveData": true, "projectOwner": "Algoretico ", "selectedTeam": [], "serverConfig": {"os": "ubuntu-22.04", "cpu": "2", "memory": "4", "region": "eu-west-1", "storage": "20"}, "stakeholders": "Test, Due, Tre", "targetSystem": "Test Java ", "addKubernetes": false, "addTypeScript": false, "cacheStrategy": "aggressive", "dataRetention": "90", "enableGrafana": true, "enableGraphQL": false, "enableLinting": true, "errorHandling": "strict", "generateTests": false, "sourceDialect": "", "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "alertThreshold": "90", "apiGatewayAuth": "jwt", "apiGatewayType": "rest", "branchStrategy": "main", "dbInstanceSize": "medium", "enableRollback": true, "encryptionType": "aes256", "infrastructure": "kubernetes", "notifyChannels": ["email", "slack", "teams", "sms", "webhook"], "packageManager": "npm", "schemaFileName": "", "sourceDatabase": "", "variableNaming": "preserve", "backupFrequency": "daily", "backupRetention": "30", "businessContact": "Michele ", "excludePatterns": "", "includePatterns": "", "notifyOnFailure": true, "notifyOnWarning": true, "preserveIndexes": true, "secretsProvider": "aws", "sourceDbVersion": "", "enableApiGateway": true, "enableAutoDeploy": false, "enableBuildTests": true, "enableEncryption": true, "enablePrometheus": true, "namingConvention": "camelCase", "notifyOnComplete": true, "preserveComments": true, "projectStructure": "standard", "selectedDatabase": "postgresql", "selectedPriority": "medium", "selectedProvider": "GitHub", "technicalContact": "Michele ", "testingFramework": "jest", "deployEnvironment": "staging", "enableOpenAPISpec": true, "enableReadReplica": true, "enableServiceMesh": false, "migrationStrategy": "full", "addTypeAnnotations": false, "enableHealthChecks": true, "enableManualReview": true, "enableMinification": true, "enableSecurityScan": true, "preserveFormatting": false, "selectedCompliance": ["gdpr", "sox", "pci", "iso27001", "hipaa"], "architecturePattern": "layered", "confidenceThreshold": 95, "enableContainerScan": true, "translationStrategy": "semantic", "enableConnectionPool": true, "enableDatabaseConfig": false, "enableDependencyScan": true, "enableSecretsManager": true, "preserveApiSignatures": true, "preserveBusinessLogic": true, "enableDeploymentConfig": false, "enableDisasterRecovery": false, "enableEnvironmentConfig": false, "enableVulnerabilityScan": true}
proj-secb-complete	SECB Banking Core	Full migration of SECB core banking COBOL mainframe system to Java Spring Boot 3.2 — Account management, transaction processing, daily/monthly batch routines, and reporting modules.	completed	https://github.com/scriba-ai-dev/test-cobol	COBOL-85	Java 22	2026-04-09 00:45:15.20682	2026-04-12 09:37:19.509	2026-04-11 23:45:15.20682	15	4820	15	96.8	91.4	18.5	45 min	38 min 12s	[{"name": "Michele Laurelli", "role": "Project Lead", "avatar": "ML"}, {"name": "Marco Bianchi", "role": "Backend Engineer", "avatar": "MB"}, {"name": "Sara Conti", "role": "QA Engineer", "avatar": "SC"}]	["banking", "cobol", "java", "spring-boot", "mainframe"]	[{"id": "act-1775986639509", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-12T09:37:19.509Z"}, {"id": "act-100", "user": "Scriba Engine", "action": "Migration completed — 96.8% parity", "timestamp": "2026-04-11T22:45:00Z"}, {"id": "act-99", "user": "Scriba Engine", "action": "Final verification passed — all 8 quality gates OK", "timestamp": "2026-04-11T22:44:00Z"}, {"id": "act-98", "user": "Scriba Engine", "action": "Security scan completed — 0 critical vulnerabilities", "timestamp": "2026-04-11T22:40:00Z"}, {"id": "act-97", "user": "Scriba Engine", "action": "Test generation completed — 147 unit tests, 42 integration tests", "timestamp": "2026-04-11T22:38:00Z"}, {"id": "act-96", "user": "Scriba Engine", "action": "Neural translation completed — 6 source files → 18 Java classes", "timestamp": "2026-04-11T22:30:00Z"}, {"id": "act-95", "user": "Scriba Engine", "action": "Analysis completed — 15 files, 4,820 LOC, avg complexity 14.2", "timestamp": "2026-04-11T22:20:00Z"}, {"id": "act-94", "user": "Michele Laurelli", "action": "Migration started", "timestamp": "2026-04-11T22:15:00Z"}, {"id": "act-93", "user": "Michele Laurelli", "action": "Pre-analysis completed", "timestamp": "2026-04-11T22:10:00Z"}, {"id": "act-92", "user": "Michele Laurelli", "action": "Repository connected", "timestamp": "2026-04-11T21:50:00Z"}, {"id": "act-91", "user": "Michele Laurelli", "action": "Project created", "timestamp": "2026-04-08T14:00:00Z"}]	4	5	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"branch": "main", "deadline": "2026-04-20", "riskLevel": "medium", "completedAt": "2026-04-11T22:45:00Z", "businessUnit": "Core Banking", "projectOwner": "Algoretico", "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "analysisResults": {"risk": {"low": 2, "high": 1, "items": [{"file": "ACCTPROC.cbl", "level": "high", "factors": ["Cyclomatic complexity 28", "Nesting depth 7", "3 external CALL statements"]}, {"file": "ACCTMAIN.cbl", "level": "medium", "factors": ["Cyclomatic complexity 22", "4 CALL dispatches"]}, {"file": "ACCTREPT.cbl", "level": "medium", "factors": ["Complex report formatting", "WRITE AFTER ADVANCING"]}, {"file": "ACCTBAL.cbl", "level": "medium", "factors": ["Decimal arithmetic precision"]}, {"file": "ACCTOPEN.cbl", "level": "low", "factors": ["Simple CRUD operations"]}, {"file": "ACCTCLSE.cbl", "level": "low", "factors": ["Simple status update"]}], "medium": 3}, "languages": {"JCL": 15.8, "Text": 3.6, "COBOL": 72.4, "Copybook": 8.2}, "complexity": {"avgNesting": 3.8, "maxNesting": 7, "avgCyclomatic": 14.2, "maxCyclomatic": 28, "totalSections": 18, "avgLinesPerFile": 607, "totalProcedures": 42}, "scanResults": {"jclFiles": 3, "codeLines": 3640, "copybooks": 3, "blankLines": 400, "otherFiles": 3, "totalFiles": 15, "totalLines": 4820, "sourceFiles": 6, "commentLines": 780, "totalSizeBytes": 187400}, "dependencies": {"items": [{"to": "ACCTCOMN.cpy", "from": "ACCTMAIN", "type": "COPY"}, {"to": "ACCTMASTR.cpy", "from": "ACCTMAIN", "type": "COPY"}, {"to": "ACCTBAL", "from": "ACCTMAIN", "type": "CALL"}, {"to": "ACCTOPEN", "from": "ACCTMAIN", "type": "CALL"}, {"to": "ACCTCLSE", "from": "ACCTMAIN", "type": "CALL"}, {"to": "ACCTPROC", "from": "ACCTMAIN", "type": "CALL"}, {"to": "MOVRECORD.cpy", "from": "ACCTPROC", "type": "COPY"}, {"to": "ACCTREPT", "from": "ACCTPROC", "type": "CALL"}], "copybooks": 3, "circularDeps": 0, "externalCalls": 8, "totalDependencies": 24}}, "conversionResult": {"files": [{"accuracy": 97, "iterations": 2, "outputPath": "src/main/java/com/secb/AccountMainService.java", "sourcePath": "src/ACCTMAIN.cbl"}, {"accuracy": 98, "iterations": 1, "outputPath": "src/main/java/com/secb/AccountBalanceService.java", "sourcePath": "src/ACCTBAL.cbl"}, {"accuracy": 96, "iterations": 2, "outputPath": "src/main/java/com/secb/AccountOpenService.java", "sourcePath": "src/ACCTOPEN.cbl"}, {"accuracy": 97, "iterations": 1, "outputPath": "src/main/java/com/secb/AccountCloseService.java", "sourcePath": "src/ACCTCLSE.cbl"}, {"accuracy": 95, "iterations": 2, "outputPath": "src/main/java/com/secb/AccountProcessingService.java", "sourcePath": "src/ACCTPROC.cbl"}, {"accuracy": 98, "iterations": 1, "outputPath": "src/main/java/com/secb/AccountReportService.java", "sourcePath": "src/ACCTREPT.cbl"}], "status": "success", "metadata": {"errors": [], "accuracy": 96.8, "warnings": ["ACCTPROC.cbl: complex nested PERFORM loop restructured as recursive method", "ACCTMAIN.cbl: CALL statement mapped to Spring service injection"], "iterations": 2, "conversionTime": 2292.4, "linesProcessed": 4820}, "conversionId": "cv-secb-001"}, "namingConvention": "camelCase", "preserveComments": true, "selectedDatabase": "postgresql", "selectedPriority": "high", "testingFramework": "junit5", "enableHealthChecks": true, "enableSecurityScan": true, "selectedCompliance": ["gdpr", "sox", "pci"], "architecturePattern": "layered", "confidenceThreshold": 95, "translationStrategy": "semantic", "preserveBusinessLogic": true}
proj-j74x	vchcvhgfhgf	gfhgfhgff	analyzing	https://github.com/scriba-ai-dev/test-cobol	cobol	java	2026-04-12 12:31:42.608752	2026-04-12 10:32:02.573	\N	0	0	0	0	0	0	\N	\N	[]	["banking"]	[{"id": "act-1775989922573", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T10:32:02.573Z"}, {"id": "act-1775989914850", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-12T10:31:54.850Z"}, {"id": "act-1775989911038", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-12T10:31:51.038Z"}, {"id": "act-1775989904264", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T10:31:44.264Z"}, {"id": "act-1775989902608", "user": "System", "action": "Project created", "timestamp": "2026-04-12T10:31:42.608Z"}]	3	0	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"addCI": true, "branch": "main", "sshKey": "", "addDocs": true, "addTests": true, "deadline": "2026-04-30", "drRegion": "us-west-2", "encoding": "UTF-8", "addDocker": true, "addLinter": true, "buildTool": "npm", "codeStyle": "standard", "dbStorage": "100", "dbVersion": "15", "enableELK": true, "enableIAM": true, "iamPolicy": "least-privilege", "riskLevel": "medium", "authMethod": "Personal Access Token", "enableDAST": false, "enableSAST": true, "selectedCI": "github", "targetArch": "", "customRules": "", "projectCode": "", "targetBuild": "Spring Boot", "addFormatter": true, "apiFramework": "express", "businessUnit": "ghjhgj", "enableBackup": true, "enableJaeger": true, "estimatedLOC": "500k", "legacySystem": "ghjhgjg", "preserveData": true, "projectOwner": "bhjhjhg", "selectedTeam": [], "serverConfig": {"os": "ubuntu-22.04", "cpu": "2", "memory": "4", "region": "eu-west-1", "storage": "20"}, "stakeholders": "", "targetSystem": "hbvjhgj", "addKubernetes": false, "addTypeScript": false, "cacheStrategy": "aggressive", "dataRetention": "90", "enableGrafana": true, "enableGraphQL": false, "enableLinting": true, "errorHandling": "strict", "generateTests": false, "sourceDialect": "", "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "alertThreshold": "90", "apiGatewayAuth": "jwt", "apiGatewayType": "rest", "branchStrategy": "main", "dbInstanceSize": "medium", "enableRollback": true, "encryptionType": "aes256", "infrastructure": "kubernetes", "notifyChannels": ["email"], "packageManager": "npm", "schemaFileName": "", "sourceDatabase": "", "variableNaming": "preserve", "backupFrequency": "daily", "backupRetention": "30", "businessContact": "", "excludePatterns": "", "includePatterns": "", "notifyOnFailure": true, "notifyOnWarning": true, "preserveIndexes": true, "secretsProvider": "aws", "sourceDbVersion": "", "enableApiGateway": false, "enableAutoDeploy": false, "enableBuildTests": true, "enableEncryption": true, "enablePrometheus": true, "namingConvention": "camelCase", "notifyOnComplete": true, "preserveComments": true, "projectStructure": "standard", "selectedDatabase": "postgresql", "selectedPriority": "medium", "selectedProvider": "GitHub", "technicalContact": "", "testingFramework": "jest", "deployEnvironment": "staging", "enableOpenAPISpec": true, "enableReadReplica": true, "enableServiceMesh": false, "migrationStrategy": "full", "addTypeAnnotations": false, "enableHealthChecks": true, "enableManualReview": true, "enableMinification": true, "enableSecurityScan": true, "preserveFormatting": false, "selectedCompliance": ["iso27001", "pci", "hipaa"], "architecturePattern": "layered", "confidenceThreshold": 93, "enableContainerScan": true, "translationStrategy": "semantic", "enableConnectionPool": true, "enableDatabaseConfig": false, "enableDependencyScan": true, "enableSecretsManager": true, "preserveApiSignatures": true, "preserveBusinessLogic": true, "enableDeploymentConfig": false, "enableDisasterRecovery": false, "enableEnvironmentConfig": false, "enableVulnerabilityScan": true}
proj-uu4l	Test BIP RED 	Test BIP RED 	analyzing	https://github.com/scriba-ai-dev/test-cobol	cobol	java	2026-04-13 17:08:22.168367	2026-04-13 15:08:23.807	\N	0	0	0	0	0	0	\N	\N	[]	["banking"]	[{"id": "act-1776092903807", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-13T15:08:23.807Z"}, {"id": "act-1776092902167", "user": "System", "action": "Project created", "timestamp": "2026-04-13T15:08:22.167Z"}]	3	0	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"addCI": true, "branch": "main", "sshKey": "", "addDocs": true, "addTests": true, "deadline": "", "drRegion": "us-west-2", "encoding": "EBCDIC", "addDocker": false, "addLinter": true, "buildTool": "npm", "codeStyle": "standard", "dbStorage": "100", "dbVersion": "15", "enableELK": true, "enableIAM": true, "iamPolicy": "least-privilege", "riskLevel": "medium", "authMethod": "Personal Access Token", "enableDAST": false, "enableSAST": true, "selectedCI": "github", "targetArch": "", "customRules": "", "projectCode": "", "targetBuild": "Spring Boot", "addFormatter": true, "apiFramework": "express", "businessUnit": "", "enableBackup": true, "enableJaeger": true, "estimatedLOC": "", "legacySystem": "", "preserveData": false, "projectOwner": "", "selectedTeam": [], "serverConfig": {"os": "ubuntu-22.04", "cpu": "8", "memory": "4", "region": "eu-west-1", "storage": "20"}, "stakeholders": "", "targetSystem": "", "addKubernetes": false, "addTypeScript": false, "cacheStrategy": "aggressive", "dataRetention": "90", "enableGrafana": true, "enableGraphQL": true, "enableLinting": true, "errorHandling": "strict", "generateTests": false, "sourceDialect": "", "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "alertThreshold": "90", "apiGatewayAuth": "jwt", "apiGatewayType": "rest", "branchStrategy": "main", "dbInstanceSize": "medium", "enableRollback": true, "encryptionType": "aes256", "infrastructure": "kubernetes", "notifyChannels": [], "packageManager": "npm", "schemaFileName": "", "sourceDatabase": "", "variableNaming": "preserve", "backupFrequency": "daily", "backupRetention": "30", "businessContact": "", "excludePatterns": "", "includePatterns": "", "notifyOnFailure": true, "notifyOnWarning": true, "preserveIndexes": false, "secretsProvider": "aws", "sourceDbVersion": "", "enableApiGateway": true, "enableAutoDeploy": false, "enableBuildTests": true, "enableEncryption": true, "enablePrometheus": true, "namingConvention": "camelCase", "notifyOnComplete": true, "preserveComments": true, "projectStructure": "standard", "selectedDatabase": "postgresql", "selectedPriority": "medium", "selectedProvider": "GitHub", "technicalContact": "", "testingFramework": "junit", "deployEnvironment": "staging", "enableOpenAPISpec": true, "enableReadReplica": true, "enableServiceMesh": false, "migrationStrategy": "full", "addTypeAnnotations": false, "enableHealthChecks": true, "enableManualReview": true, "enableMinification": true, "enableSecurityScan": true, "preserveFormatting": false, "selectedCompliance": ["none"], "architecturePattern": "layered", "confidenceThreshold": 95, "enableContainerScan": true, "translationStrategy": "semantic", "enableConnectionPool": true, "enableDatabaseConfig": false, "enableDependencyScan": true, "enableSecretsManager": true, "preserveApiSignatures": true, "preserveBusinessLogic": true, "enableDeploymentConfig": false, "enableDisasterRecovery": false, "enableEnvironmentConfig": false, "enableVulnerabilityScan": true}
proj-demo-full	SECB Core Banking — Full Demo	Complete end-to-end migration of SECB COBOL-85 banking system to Java Spring Boot 3.2. Includes pre-analysis, translation, verification, artifacts, and downloadable ZIP.	completed	https://github.com/scriba-ai-dev/test-cobol	COBOL-85	Java 22	2026-04-10 01:00:07.017607	2026-04-14 08:38:45.847	2026-04-12 00:30:07.017607	15	4820	18	96.8	91.4	18.5	45 min	38 min 12s	[{"name": "Michele Laurelli", "role": "Project Lead", "avatar": "ML"}, {"name": "Marco Bianchi", "role": "Backend Engineer", "avatar": "MB"}, {"name": "Sara Conti", "role": "QA Engineer", "avatar": "SC"}]	["banking", "cobol", "java", "spring-boot", "mainframe", "demo"]	[{"id": "act-1776155925847", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-14T08:38:45.847Z"}, {"id": "act-1776155925326", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-14T08:38:45.326Z"}, {"id": "act-1776155924401", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-14T08:38:44.401Z"}, {"id": "act-1776155923536", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-14T08:38:43.536Z"}, {"id": "act-1776093488888", "user": "System", "action": "Completed Export", "timestamp": "2026-04-13T15:18:08.888Z"}, {"id": "act-1776093469787", "user": "System", "action": "Completed Artifacts", "timestamp": "2026-04-13T15:17:49.787Z"}, {"id": "act-1776093415254", "user": "System", "action": "Completed Verification", "timestamp": "2026-04-13T15:16:55.254Z"}, {"id": "act-1776093380571", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-13T15:16:20.571Z"}, {"id": "act-1776093348593", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-13T15:15:48.593Z"}, {"id": "act-1776093268469", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-13T15:14:28.469Z"}, {"id": "act-1776093253805", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-13T15:14:13.805Z"}, {"id": "act-1776093172754", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-13T15:12:52.754Z"}, {"id": "act-1775988740672", "user": "System", "action": "Completed Export", "timestamp": "2026-04-12T10:12:20.672Z"}, {"id": "act-1775988689444", "user": "System", "action": "Completed Artifacts", "timestamp": "2026-04-12T10:11:29.444Z"}, {"id": "act-1775988646518", "user": "System", "action": "Completed Verification", "timestamp": "2026-04-12T10:10:46.518Z"}, {"id": "act-1775988577849", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-12T10:09:37.849Z"}, {"id": "act-1775988569899", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-12T10:09:29.899Z"}, {"id": "act-1775988519276", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-12T10:08:39.276Z"}, {"id": "act-1775988488503", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T10:08:08.503Z"}, {"id": "act-1775988407073", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-12T10:06:47.073Z"}, {"id": "act-1775988366970", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-12T10:06:06.970Z"}, {"id": "act-1775986634778", "user": "System", "action": "Completed Artifacts", "timestamp": "2026-04-12T09:37:14.778Z"}, {"id": "act-1775986634013", "user": "System", "action": "Completed Verification", "timestamp": "2026-04-12T09:37:14.013Z"}, {"id": "act-1775986631744", "user": "System", "action": "Completed Code Review", "timestamp": "2026-04-12T09:37:11.744Z"}, {"id": "act-1775986629631", "user": "System", "action": "Completed Migration", "timestamp": "2026-04-12T09:37:09.631Z"}, {"id": "act-1775986628555", "user": "System", "action": "Completed Pre-Analysis", "timestamp": "2026-04-12T09:37:08.555Z"}, {"id": "act-1775986627010", "user": "System", "action": "Completed Repository", "timestamp": "2026-04-12T09:37:07.010Z"}, {"id": "act-20", "user": "Scriba Engine", "action": "ZIP package ready for download", "timestamp": "2026-04-11T23:30:00Z"}, {"id": "act-19", "user": "Scriba Engine", "action": "Migration completed — 96.8% parity score", "timestamp": "2026-04-11T23:28:00Z"}, {"id": "act-18", "user": "Scriba Engine", "action": "Final verification passed — 8/8 quality gates", "timestamp": "2026-04-11T23:27:00Z"}, {"id": "act-17", "user": "Scriba Engine", "action": "Security scan: 0 critical, score 97.8/100", "timestamp": "2026-04-11T23:25:00Z"}, {"id": "act-16", "user": "Scriba Engine", "action": "147 unit tests + 42 integration tests generated", "timestamp": "2026-04-11T23:22:00Z"}, {"id": "act-15", "user": "Scriba Engine", "action": "Translation: 6 COBOL → 18 Java classes", "timestamp": "2026-04-11T23:15:00Z"}, {"id": "act-14", "user": "Scriba Engine", "action": "Analysis: 15 files, 4820 LOC, avg complexity 14.2", "timestamp": "2026-04-11T23:05:00Z"}, {"id": "act-13", "user": "Michele Laurelli", "action": "Migration started", "timestamp": "2026-04-11T23:00:00Z"}, {"id": "act-12", "user": "Scriba Engine", "action": "Pre-analysis completed", "timestamp": "2026-04-11T22:55:00Z"}, {"id": "act-11", "user": "Michele Laurelli", "action": "Repository connected", "timestamp": "2026-04-11T22:50:00Z"}, {"id": "act-10", "user": "Michele Laurelli", "action": "Project created", "timestamp": "2026-04-09T14:00:00Z"}]	3	7	860eb995-a62d-40a0-a4c0-81912f3b79a1	{"branch": "main", "deadline": "2026-04-20", "riskLevel": "medium", "preAnalysis": {"risk": {"low": 2, "high": 1, "files": [{"name": "ACCTPROC.cbl", "path": "src/ACCTPROC.cbl", "risk": "high", "size": 42800, "lines": 1240, "nesting": 7, "codeLines": 980, "complexity": 28, "procedures": 12, "dependencies": 5}, {"name": "ACCTMAIN.cbl", "path": "src/ACCTMAIN.cbl", "risk": "medium", "size": 31200, "lines": 890, "nesting": 5, "codeLines": 680, "complexity": 22, "procedures": 8, "dependencies": 6}, {"name": "ACCTREPT.cbl", "path": "src/ACCTREPT.cbl", "risk": "medium", "size": 25100, "lines": 720, "nesting": 4, "codeLines": 540, "complexity": 16, "procedures": 6, "dependencies": 3}, {"name": "ACCTBAL.cbl", "path": "src/ACCTBAL.cbl", "risk": "medium", "size": 22400, "lines": 650, "nesting": 4, "codeLines": 490, "complexity": 14, "procedures": 5, "dependencies": 2}, {"name": "ACCTOPEN.cbl", "path": "src/ACCTOPEN.cbl", "risk": "low", "size": 16700, "lines": 480, "nesting": 3, "codeLines": 360, "complexity": 8, "procedures": 4, "dependencies": 2}, {"name": "ACCTCLSE.cbl", "path": "src/ACCTCLSE.cbl", "risk": "low", "size": 13200, "lines": 380, "nesting": 2, "codeLines": 290, "complexity": 6, "procedures": 3, "dependencies": 1}], "medium": 3}, "complexity": {"avgLines": 607, "maxLines": 1240, "avgNesting": 3.8, "maxNesting": 7, "avgCyclomatic": 14.2, "maxCyclomatic": 28, "totalSections": 18, "totalProcedures": 42}, "scanResults": {"languages": [{"name": "COBOL", "bytes": 135648, "files": 6, "percentage": 72.4}, {"name": "JCL", "bytes": 29584, "files": 3, "percentage": 15.8}, {"name": "Copybook", "bytes": 15355, "files": 3, "percentage": 8.2}, {"name": "Text", "bytes": 6813, "files": 3, "percentage": 3.6}], "totalSize": 187400, "extensions": [{"ext": ".cbl", "count": 6, "percentage": 40.0}, {"ext": ".cpy", "count": 3, "percentage": 20.0}, {"ext": ".jcl", "count": 3, "percentage": 20.0}, {"ext": ".txt", "count": 3, "percentage": 20.0}], "totalFiles": 15, "totalLines": 4820, "totalCodeLines": 3640, "totalBlankLines": 400, "totalDirectories": 5, "totalSourceFiles": 6, "totalCommentLines": 780}, "dependencies": {"list": ["ACCTCOMN.cpy", "ACCTMASTR.cpy", "MOVRECORD.cpy", "ACCTBAL", "ACCTOPEN", "ACCTCLSE", "ACCTPROC", "ACCTREPT"], "total": 24, "copybooks": 3, "orphanFiles": 0, "circularDeps": 0, "externalCalls": 8}, "analyzedFileCount": 15}, "businessUnit": "Core Banking", "projectOwner": "Algoretico", "sourceVersion": "COBOL-85", "targetVersion": "Java 22", "analysisResults": {"tests": {"metrics": {"tests": 189, "failed": 3, "passed": 186, "skipped": 0}}, "security": {"metrics": {"score": 97.8, "issues": 2, "vulnerabilities": 0}}, "performance": {"metrics": {"memory": 384, "latency": 14, "throughput": 1450}}, "translation": {"files": [{"id": "f1", "confidence": 97.2, "reasonings": ["Spring Boot was chosen as the target framework because it provides dependency injection, lifecycle management, and enterprise-grade features that map naturally to COBOL batch processing patterns.", "The CALL/USING pattern in COBOL directly maps to Spring service injection — each called program becomes a @Service bean.", "Lombok @RequiredArgsConstructor eliminates boilerplate while maintaining the same dependency structure as the COBOL CALL graph."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTMAIN                                         *\\n      * DESCRIZIONE:  Programma principale di controllo flusso per il   *\\n      *               Sistema Elaborazione Conti Bancari (SECB).       *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTMAIN.\\n       AUTHOR. ROSSI-MARIO.\\n       DATE-WRITTEN. 15-MAR-1995.\\n\\n       ENVIRONMENT DIVISION.\\n       INPUT-OUTPUT SECTION.\\n       FILE-CONTROL.\\n           SELECT LOG-FILE\\n               ASSIGN TO UT-S-LOGFILE\\n               FILE STATUS IS WS-LOG-STATUS.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-GENERALI.\\n           05  WS-PROGRAMMA       PIC X(8) VALUE 'ACCTMAIN'.\\n           05  WS-VERSIONE        PIC X(6) VALUE 'V2.3.1'.\\n           05  WS-RC-PRINCIPALE   PIC 9(4) COMP VALUE 0.\\n       01  WS-CONTATORI.\\n           05  WS-CONTI-ELAB      PIC 9(8) COMP VALUE 0.\\n           05  WS-CONTI-OK        PIC 9(8) COMP VALUE 0.\\n           05  WS-CONTI-ERR       PIC 9(8) COMP VALUE 0.\\n\\n       PROCEDURE DIVISION.\\n       MAIN-PROGRAM.\\n           PERFORM INIZIALIZZA\\n           PERFORM ELABORA-GIORNALIERA\\n           PERFORM CHIUDI-ELABORAZIONE\\n           STOP RUN.\\n\\n       INIZIALIZZA.\\n           OPEN OUTPUT LOG-FILE\\n           DISPLAY 'SECB V2.3.1 - Avvio elaborazione'.\\n\\n       ELABORA-GIORNALIERA.\\n           CALL 'ACCTBAL'  USING WS-RC-PRINCIPALE\\n           CALL 'ACCTOPEN' USING WS-RC-PRINCIPALE\\n           CALL 'ACCTPROC' USING WS-RC-PRINCIPALE\\n           CALL 'ACCTREPT' USING WS-RC-PRINCIPALE.\\n\\n       CHIUDI-ELABORAZIONE.\\n           CLOSE LOG-FILE\\n           DISPLAY 'Elaborazione completata'.", "sourceFile": "src/ACCTMAIN.cbl", "targetCode": "package com.secb.service;\\n\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.boot.CommandLineRunner;\\nimport org.springframework.stereotype.Service;\\n\\n/**\\n * ACCTMAIN — Main processing controller for SECB Banking System.\\n * Manages the daily processing cycle.\\n * @version 2.3.1\\n * @migrated-from ACCTMAIN.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountMainService implements CommandLineRunner {\\n\\n    private final AccountBalanceService accountBalanceService;\\n    private final AccountOpenService accountOpenService;\\n    private final AccountProcessingService accountProcessingService;\\n    private final AccountReportService accountReportService;\\n\\n    private int processedCount = 0;\\n    private int successCount = 0;\\n    private int errorCount = 0;\\n\\n    @Override\\n    public void run(String... args) {\\n        log.info(\\"SECB V2.3.1 — Starting daily processing\\");\\n        initialize();\\n        executeDailyProcessing();\\n        closeProcessing();\\n    }\\n\\n    private void initialize() {\\n        log.info(\\"Initializing SECB processing engine\\");\\n        processedCount = 0;\\n        successCount = 0;\\n        errorCount = 0;\\n    }\\n\\n    private void executeDailyProcessing() {\\n        accountBalanceService.process();\\n        accountOpenService.process();\\n        accountProcessingService.process();\\n        accountReportService.process();\\n    }\\n\\n    private void closeProcessing() {\\n        log.info(\\"Processing complete — {} processed, {} OK, {} errors\\",\\n            processedCount, successCount, errorCount);\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountMainService.java", "linesSource": 48, "linesTarget": 52, "explanations": ["COBOL CALL statements mapped to Spring @RequiredArgsConstructor dependency injection", "WORKING-STORAGE variables converted to private instance fields with appropriate Java types", "FILE-CONTROL log file replaced with SLF4J structured logging", "PERFORM paragraph calls converted to private method invocations", "STOP RUN replaced by CommandLineRunner lifecycle completion"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-001", "source": "ELABORA-GIORNALIERA paragraph", "target": "executeDailyProcessing() method", "confidence": 98, "description": "Daily processing must execute in sequence: Balance → Open → Process → Report"}, {"id": "BR-002", "source": "WS-CONTATORI group", "target": "processedCount/successCount/errorCount fields", "confidence": 97, "description": "Processing counters must track total, success, and error counts"}, {"id": "BR-003", "source": "OPEN/CLOSE LOG-FILE", "target": "SLF4J initialize()/closeProcessing()", "confidence": 95, "description": "Log file must be opened before processing and closed after"}], "confidenceScores": [{"block": "IDENTIFICATION DIVISION → Class declaration", "lines": "1-8", "score": 99}, {"block": "WORKING-STORAGE → Fields", "lines": "18-26", "score": 97}, {"block": "CALL statements → Service injection", "lines": "37-44", "score": 95}, {"block": "PERFORM → Method calls", "lines": "30-35", "score": 98}, {"block": "FILE-CONTROL → SLF4J logging", "lines": "12-15", "score": 93}, {"block": "Error handling flow", "lines": "45-48", "score": 96}]}, {"id": "f2", "confidence": 96.5, "reasonings": ["BigDecimal is mandatory for financial calculations — Java float/double would introduce rounding errors incompatible with COBOL COMP-3 precision.", "Spring Data JPA replaces VSAM file I/O because it provides the same sequential and random access patterns with a modern persistence layer."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTBAL                                          *\\n      * DESCRIZIONE:  Calcolo e aggiornamento saldi conti correnti     *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTBAL.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-SALDI.\\n           05  WS-SALDO-CORRENTE  PIC S9(9)V99 COMP-3.\\n           05  WS-MOVIMENTI-PEND  PIC S9(9)V99 COMP-3.\\n           05  WS-SALDO-NUOVO     PIC S9(9)V99 COMP-3.\\n           05  WS-NUM-CONTI       PIC 9(8) COMP VALUE 0.\\n       01  WS-ACCOUNT-REC.\\n           05  WS-ACCT-NUM        PIC X(10).\\n           05  WS-ACCT-NAME       PIC X(30).\\n           05  WS-ACCT-TYPE       PIC X(1).\\n           05  WS-ACCT-BALANCE    PIC S9(9)V99 COMP-3.\\n           05  WS-ACCT-STATUS     PIC X(1).\\n\\n       PROCEDURE DIVISION.\\n       CALCOLO-SALDI.\\n           PERFORM LEGGI-CONTI-ATTIVI\\n           PERFORM VARYING WS-NUM-CONTI\\n               FROM 1 BY 1\\n               UNTIL WS-NUM-CONTI > WS-TOTALE-CONTI\\n               PERFORM CALCOLA-SALDO-SINGOLO\\n           END-PERFORM\\n           DISPLAY 'Aggiornamento saldi completato'\\n           GOBACK.\\n\\n       CALCOLA-SALDO-SINGOLO.\\n           MOVE WS-ACCT-BALANCE TO WS-SALDO-CORRENTE\\n           ADD WS-MOVIMENTI-PEND TO WS-SALDO-CORRENTE\\n               GIVING WS-SALDO-NUOVO\\n           MOVE WS-SALDO-NUOVO TO WS-ACCT-BALANCE\\n           PERFORM AGGIORNA-RECORD.\\n\\n       LEGGI-CONTI-ATTIVI.\\n           OPEN INPUT ACCOUNT-FILE\\n           READ ACCOUNT-FILE INTO WS-ACCOUNT-REC\\n               AT END SET WS-EOF TO TRUE\\n           END-READ.\\n\\n       AGGIORNA-RECORD.\\n           REWRITE ACCOUNT-RECORD FROM WS-ACCOUNT-REC.", "sourceFile": "src/ACCTBAL.cbl", "targetCode": "package com.secb.service;\\n\\nimport com.secb.model.Account;\\nimport com.secb.repository.AccountRepository;\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.stereotype.Service;\\nimport org.springframework.transaction.annotation.Transactional;\\n\\nimport java.math.BigDecimal;\\nimport java.util.List;\\n\\n/**\\n * ACCTBAL — Account Balance Service.\\n * Computes and updates account balances based on pending transactions.\\n * @migrated-from ACCTBAL.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountBalanceService {\\n\\n    private final AccountRepository accountRepository;\\n\\n    @Transactional\\n    public void process() {\\n        log.info(\\"Starting balance calculation\\");\\n        List<Account> accounts = accountRepository.findByStatus(\\"ACTIVE\\");\\n\\n        for (Account account : accounts) {\\n            BigDecimal balance = computeBalance(account);\\n            account.setBalance(balance);\\n            account.setLastProcessedDate(java.time.LocalDate.now());\\n            accountRepository.save(account);\\n        }\\n\\n        log.info(\\"Balance calculation complete — {} accounts updated\\",\\n            accounts.size());\\n    }\\n\\n    private BigDecimal computeBalance(Account account) {\\n        BigDecimal current = account.getBalance();\\n        BigDecimal pending = account.getPendingAmount() != null\\n            ? account.getPendingAmount() : BigDecimal.ZERO;\\n        return current.add(pending);\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountBalanceService.java", "linesSource": 52, "linesTarget": 48, "explanations": ["COMP-3 packed decimal fields are mapped to java.math.BigDecimal for exact financial arithmetic", "The PERFORM VARYING loop becomes a standard Java enhanced for-loop over JPA query results", "REWRITE file record is replaced by JPA accountRepository.save() with @Transactional annotation", "OPEN INPUT / READ / AT END pattern replaced by Spring Data JPA findByStatus query"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-004", "source": "ADD WS-MOVIMENTI-PEND TO WS-SALDO-CORRENTE GIVING WS-SALDO-NUOVO", "target": "current.add(pending)", "confidence": 99, "description": "Balance = Current Balance + Pending Movements"}, {"id": "BR-005", "source": "LEGGI-CONTI-ATTIVI paragraph", "target": "findByStatus(\\"ACTIVE\\")", "confidence": 98, "description": "Only ACTIVE accounts are processed for balance update"}], "confidenceScores": [{"block": "PIC S9(9)V99 COMP-3 → BigDecimal", "lines": "10-13", "score": 98}, {"block": "PERFORM VARYING → for loop", "lines": "24-29", "score": 96}, {"block": "REWRITE → JPA save()", "lines": "44-45", "score": 97}, {"block": "FILE-CONTROL → Repository", "lines": "38-42", "score": 94}]}, {"id": "f3", "confidence": 97.8, "reasonings": ["String-based status values were chosen over Java enums to maintain compatibility with the database schema and make status transitions explicit.", "The validation logic preserves the exact same checks as the COBOL source — no additional validation was added to maintain functional parity."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTOPEN                                         *\\n      * DESCRIZIONE:  Apertura nuovi conti correnti                    *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTOPEN.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-NEW-ACCOUNT.\\n           05  WS-NEW-ACCT-NUM    PIC X(10).\\n           05  WS-NEW-ACCT-NAME   PIC X(30).\\n           05  WS-NEW-ACCT-TYPE   PIC X(1).\\n               88  TIPO-CORRENTE  VALUE 'C'.\\n               88  TIPO-RISPARMIO VALUE 'R'.\\n           05  WS-NEW-STATUS      PIC X(1) VALUE 'P'.\\n               88  STATUS-PENDING VALUE 'P'.\\n               88  STATUS-ACTIVE  VALUE 'A'.\\n               88  STATUS-REJECT  VALUE 'R'.\\n\\n       PROCEDURE DIVISION.\\n       APRI-CONTO.\\n           PERFORM LEGGI-RICHIESTE-PENDING\\n           PERFORM VALIDA-DATI-CONTO\\n           IF WS-DATI-VALIDI\\n               SET STATUS-ACTIVE TO TRUE\\n               MOVE FUNCTION CURRENT-DATE TO WS-DATA-APERTURA\\n               MOVE ZEROS TO WS-NEW-BALANCE\\n               PERFORM SCRIVI-NUOVO-CONTO\\n               DISPLAY 'Conto aperto: ' WS-NEW-ACCT-NUM\\n           ELSE\\n               SET STATUS-REJECT TO TRUE\\n               PERFORM SCRIVI-RIFIUTO\\n               DISPLAY 'Conto rifiutato: ' WS-NEW-ACCT-NUM\\n           END-IF\\n           GOBACK.\\n\\n       VALIDA-DATI-CONTO.\\n           IF WS-NEW-ACCT-NAME = SPACES\\n               SET WS-DATI-VALIDI TO FALSE\\n           END-IF\\n           IF WS-NEW-ACCT-TYPE NOT = 'C' AND 'R'\\n               SET WS-DATI-VALIDI TO FALSE\\n           END-IF.", "sourceFile": "src/ACCTOPEN.cbl", "targetCode": "package com.secb.service;\\n\\nimport com.secb.model.Account;\\nimport com.secb.repository.AccountRepository;\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.stereotype.Service;\\nimport org.springframework.transaction.annotation.Transactional;\\n\\nimport java.math.BigDecimal;\\nimport java.time.LocalDate;\\n\\n/**\\n * ACCTOPEN — Account Opening Service.\\n * Processes new account requests and validates initial data.\\n * @migrated-from ACCTOPEN.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountOpenService {\\n\\n    private final AccountRepository accountRepository;\\n\\n    @Transactional\\n    public void process() {\\n        log.info(\\"Processing pending account openings\\");\\n        var pending = accountRepository.findByStatus(\\"PENDING_OPEN\\");\\n\\n        for (Account account : pending) {\\n            if (validateAccountData(account)) {\\n                account.setStatus(\\"ACTIVE\\");\\n                account.setOpenDate(LocalDate.now());\\n                account.setBalance(BigDecimal.ZERO);\\n                accountRepository.save(account);\\n                log.info(\\"Account {} opened successfully\\",\\n                    account.getAccountNumber());\\n            } else {\\n                account.setStatus(\\"REJECTED\\");\\n                accountRepository.save(account);\\n                log.warn(\\"Account {} rejected — invalid data\\",\\n                    account.getAccountNumber());\\n            }\\n        }\\n\\n        log.info(\\"Account opening complete — {} processed\\", pending.size());\\n    }\\n\\n    private boolean validateAccountData(Account account) {\\n        if (account.getAccountName() == null\\n            || account.getAccountName().isBlank()) return false;\\n        if (account.getAccountType() == null) return false;\\n        return true;\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountOpenService.java", "linesSource": 42, "linesTarget": 52, "explanations": ["COBOL 88-level condition names are mapped to String status constants — Java enums could also be used", "SET STATUS-ACTIVE TO TRUE becomes account.setStatus(\\"ACTIVE\\") — preserving the state machine semantics", "FUNCTION CURRENT-DATE is replaced by java.time.LocalDate.now() for the opening date", "MOVE ZEROS TO becomes BigDecimal.ZERO assignment"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-006", "source": "IF WS-NEW-ACCT-NAME = SPACES", "target": "getAccountName().isBlank()", "confidence": 99, "description": "Account name must not be blank for opening approval"}, {"id": "BR-007", "source": "88 TIPO-CORRENTE / TIPO-RISPARMIO", "target": "getAccountType() null check", "confidence": 96, "description": "Account type must be C (Current) or R (Savings)"}, {"id": "BR-008", "source": "MOVE ZEROS TO WS-NEW-BALANCE", "target": "setBalance(BigDecimal.ZERO)", "confidence": 99, "description": "New accounts start with zero balance"}], "confidenceScores": [{"block": "88-level conditions → enum/status strings", "lines": "14-19", "score": 98}, {"block": "IF/ELSE validation → validateAccountData()", "lines": "36-42", "score": 97}, {"block": "SET STATUS-ACTIVE → setStatus(\\"ACTIVE\\")", "lines": "25-28", "score": 99}, {"block": "FUNCTION CURRENT-DATE → LocalDate.now()", "lines": "27", "score": 99}]}, {"id": "f4", "confidence": 94.8, "reasonings": ["This was the highest-complexity file (cyclomatic: 28). The Java switch expression provides cleaner control flow than the EVALUATE TRUE pattern while preserving identical business logic.", "Exception-based error handling was chosen over return codes because it integrates with Spring @Transactional rollback on failure.", "The insufficient funds check preserves the exact same comparison as COBOL: balance >= amount (not >)."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTPROC                                         *\\n      * DESCRIZIONE:  Elaborazione movimenti e transazioni bancarie    *\\n      * COMPLESSITA:  Alta — gestione errori, rollback, audit trail    *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTPROC.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-TRANSAZIONE.\\n           05  WS-TXN-ID          PIC 9(12).\\n           05  WS-TXN-ACCT        PIC X(10).\\n           05  WS-TXN-TIPO        PIC X(6).\\n               88  TXN-CREDITO    VALUE 'CREDIT'.\\n               88  TXN-DEBITO     VALUE 'DEBIT '.\\n           05  WS-TXN-IMPORTO     PIC S9(9)V99 COMP-3.\\n           05  WS-TXN-STATUS      PIC X(10) VALUE 'PENDING'.\\n       01  WS-CONTATORI-TXN.\\n           05  WS-TXN-ELABORATI   PIC 9(8) COMP VALUE 0.\\n           05  WS-TXN-ERRORI      PIC 9(8) COMP VALUE 0.\\n\\n       PROCEDURE DIVISION.\\n       ELABORA-TRANSAZIONI.\\n           OPEN INPUT TXN-FILE\\n           PERFORM UNTIL WS-EOF\\n               READ TXN-FILE INTO WS-TRANSAZIONE\\n                   AT END SET WS-EOF TO TRUE\\n                   NOT AT END PERFORM PROCESSA-SINGOLA-TXN\\n               END-READ\\n           END-PERFORM\\n           CLOSE TXN-FILE\\n           DISPLAY 'Transazioni: ' WS-TXN-ELABORATI\\n                   ' errori: ' WS-TXN-ERRORI\\n           GOBACK.\\n\\n       PROCESSA-SINGOLA-TXN.\\n           PERFORM VALIDA-CONTO\\n           IF WS-CONTO-VALIDO\\n               EVALUATE TRUE\\n                   WHEN TXN-CREDITO\\n                       ADD WS-TXN-IMPORTO TO WS-ACCT-BALANCE\\n                   WHEN TXN-DEBITO\\n                       IF WS-ACCT-BALANCE >= WS-TXN-IMPORTO\\n                           SUBTRACT WS-TXN-IMPORTO\\n                               FROM WS-ACCT-BALANCE\\n                       ELSE\\n                           MOVE 'FAILED' TO WS-TXN-STATUS\\n                           ADD 1 TO WS-TXN-ERRORI\\n                           DISPLAY 'Fondi insufficienti: '\\n                               WS-TXN-ACCT\\n                       END-IF\\n                   WHEN OTHER\\n                       MOVE 'FAILED' TO WS-TXN-STATUS\\n                       ADD 1 TO WS-TXN-ERRORI\\n               END-EVALUATE\\n               MOVE 'COMPLETED' TO WS-TXN-STATUS\\n               ADD 1 TO WS-TXN-ELABORATI\\n               PERFORM AGGIORNA-AUDIT-TRAIL\\n           ELSE\\n               MOVE 'FAILED' TO WS-TXN-STATUS\\n               ADD 1 TO WS-TXN-ERRORI\\n           END-IF.", "sourceFile": "src/ACCTPROC.cbl", "targetCode": "package com.secb.service;\\n\\nimport com.secb.model.Account;\\nimport com.secb.model.Transaction;\\nimport com.secb.repository.AccountRepository;\\nimport com.secb.repository.TransactionRepository;\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.stereotype.Service;\\nimport org.springframework.transaction.annotation.Transactional;\\n\\nimport java.math.BigDecimal;\\nimport java.time.LocalDateTime;\\nimport java.util.List;\\n\\n/**\\n * ACCTPROC — Account Transaction Processing Service.\\n * Processes daily batch of financial transactions with audit trail.\\n * @migrated-from ACCTPROC.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountProcessingService {\\n\\n    private final AccountRepository accountRepository;\\n    private final TransactionRepository transactionRepository;\\n\\n    @Transactional\\n    public void process() {\\n        log.info(\\"Starting transaction processing batch\\");\\n        List<Transaction> pending = transactionRepository\\n            .findByStatus(\\"PENDING\\");\\n\\n        int processed = 0;\\n        int errors = 0;\\n\\n        for (Transaction txn : pending) {\\n            try {\\n                processTransaction(txn);\\n                processed++;\\n            } catch (Exception e) {\\n                log.error(\\"Transaction {} failed: {}\\",\\n                    txn.getId(), e.getMessage());\\n                txn.setStatus(\\"FAILED\\");\\n                txn.setErrorMessage(e.getMessage());\\n                transactionRepository.save(txn);\\n                errors++;\\n            }\\n        }\\n\\n        log.info(\\"Transaction batch complete — {} processed, {} errors\\",\\n            processed, errors);\\n    }\\n\\n    private void processTransaction(Transaction txn) {\\n        Account account = accountRepository\\n            .findByAccountNumber(txn.getAccountNumber())\\n            .orElseThrow(() -> new IllegalStateException(\\n                \\"Account not found: \\" + txn.getAccountNumber()));\\n\\n        if (!\\"ACTIVE\\".equals(account.getStatus())) {\\n            throw new IllegalStateException(\\"Account is not active\\");\\n        }\\n\\n        BigDecimal amount = txn.getAmount();\\n\\n        switch (txn.getTransactionType()) {\\n            case \\"CREDIT\\" -> account.setBalance(\\n                account.getBalance().add(amount));\\n            case \\"DEBIT\\" -> {\\n                if (account.getBalance().compareTo(amount) < 0) {\\n                    throw new IllegalStateException(\\n                        \\"Insufficient funds\\");\\n                }\\n                account.setBalance(\\n                    account.getBalance().subtract(amount));\\n            }\\n            default -> throw new IllegalStateException(\\n                \\"Unknown transaction type: \\"\\n                + txn.getTransactionType());\\n        }\\n\\n        account.setLastTransactionDate(LocalDateTime.now());\\n        accountRepository.save(account);\\n\\n        txn.setStatus(\\"COMPLETED\\");\\n        txn.setProcessedAt(LocalDateTime.now());\\n        txn.setBalanceAfter(account.getBalance());\\n        transactionRepository.save(txn);\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountProcessingService.java", "linesSource": 68, "linesTarget": 82, "explanations": ["EVALUATE TRUE with 88-level conditions maps to Java switch expression with String patterns", "COMP-3 packed decimal arithmetic uses BigDecimal.add() / .subtract() for exact precision", "The PERFORM UNTIL EOF loop over sequential file becomes iteration over JPA query results", "Error handling: COBOL IF/ELSE + MOVE status replaced by Java try-catch with exception propagation", "Audit trail PERFORM becomes explicit save of Transaction entity with timestamp"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-009", "source": "EVALUATE TRUE WHEN TXN-CREDITO/TXN-DEBITO", "target": "switch on transactionType", "confidence": 98, "description": "CREDIT transactions add to balance, DEBIT transactions subtract"}, {"id": "BR-010", "source": "IF WS-ACCT-BALANCE >= WS-TXN-IMPORTO", "target": "balance.compareTo(amount) < 0 → throw", "confidence": 97, "description": "Debit fails if balance is less than transaction amount"}, {"id": "BR-011", "source": "PERFORM AGGIORNA-AUDIT-TRAIL", "target": "transactionRepository.save(txn) with status+timestamp", "confidence": 94, "description": "Each transaction must update audit trail after processing"}, {"id": "BR-012", "source": "MOVE 'FAILED' TO WS-TXN-STATUS", "target": "txn.setStatus(\\"FAILED\\")", "confidence": 99, "description": "Failed transactions must be marked with error status"}], "confidenceScores": [{"block": "EVALUATE TRUE → switch expression", "lines": "39-55", "score": 95}, {"block": "COMP-3 arithmetic → BigDecimal ops", "lines": "42-49", "score": 97}, {"block": "PERFORM UNTIL EOF → List iteration", "lines": "25-31", "score": 96}, {"block": "Insufficient funds check", "lines": "44-51", "score": 93}, {"block": "AUDIT-TRAIL → transaction save", "lines": "56-63", "score": 91}]}, {"id": "f5", "confidence": 98.1, "reasonings": ["This was the lowest-complexity file, allowing a very straightforward 1:1 mapping with minimal architectural decisions needed."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTCLSE                                         *\\n      * DESCRIZIONE:  Chiusura conti correnti con validazione saldo    *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTCLSE.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-CLOSE-DATA.\\n           05  WS-CLOSE-ACCT-NUM  PIC X(10).\\n           05  WS-CLOSE-BALANCE   PIC S9(9)V99 COMP-3.\\n           05  WS-CLOSE-STATUS    PIC X(1).\\n               88  CHIUSURA-OK    VALUE 'Y'.\\n               88  CHIUSURA-NO    VALUE 'N'.\\n\\n       PROCEDURE DIVISION.\\n       CHIUDI-CONTO.\\n           PERFORM LEGGI-RICHIESTE-CHIUSURA\\n           PERFORM VALIDA-CHIUSURA\\n           IF CHIUSURA-OK\\n               MOVE 'CLOSED' TO WS-ACCT-STATUS\\n               MOVE FUNCTION CURRENT-DATE TO WS-DATA-CHIUSURA\\n               PERFORM AGGIORNA-RECORD\\n               DISPLAY 'Conto chiuso: ' WS-CLOSE-ACCT-NUM\\n           ELSE\\n               DISPLAY 'Impossibile chiudere: saldo residuo '\\n                   WS-CLOSE-BALANCE\\n           END-IF\\n           GOBACK.\\n\\n       VALIDA-CHIUSURA.\\n           IF WS-CLOSE-BALANCE = ZEROS\\n               SET CHIUSURA-OK TO TRUE\\n           ELSE\\n               SET CHIUSURA-NO TO TRUE\\n           END-IF.", "sourceFile": "src/ACCTCLSE.cbl", "targetCode": "package com.secb.service;\\n\\nimport com.secb.model.Account;\\nimport com.secb.repository.AccountRepository;\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.stereotype.Service;\\nimport org.springframework.transaction.annotation.Transactional;\\n\\nimport java.math.BigDecimal;\\nimport java.time.LocalDate;\\n\\n/**\\n * ACCTCLSE — Account Closure Service.\\n * Handles account closure requests with balance validation.\\n * @migrated-from ACCTCLSE.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountCloseService {\\n\\n    private final AccountRepository accountRepository;\\n\\n    @Transactional\\n    public void process() {\\n        log.info(\\"Processing account closures\\");\\n        var closing = accountRepository\\n            .findByStatus(\\"PENDING_CLOSE\\");\\n\\n        for (Account account : closing) {\\n            if (account.getBalance()\\n                    .compareTo(BigDecimal.ZERO) == 0) {\\n                account.setStatus(\\"CLOSED\\");\\n                account.setCloseDate(LocalDate.now());\\n                accountRepository.save(account);\\n                log.info(\\"Account {} closed\\",\\n                    account.getAccountNumber());\\n            } else {\\n                log.warn(\\n                    \\"Account {} has remaining balance {}, cannot close\\",\\n                    account.getAccountNumber(),\\n                    account.getBalance());\\n            }\\n        }\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountCloseService.java", "linesSource": 32, "linesTarget": 42, "explanations": ["Simple program with clear validation logic — high confidence translation", "88-level condition CHIUSURA-OK mapped to BigDecimal.compareTo(ZERO) == 0", "MOVE 'CLOSED' becomes setStatus(\\"CLOSED\\") — direct semantic mapping"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-013", "source": "IF WS-CLOSE-BALANCE = ZEROS", "target": "balance.compareTo(BigDecimal.ZERO) == 0", "confidence": 99, "description": "Account can only be closed if balance is exactly zero"}, {"id": "BR-014", "source": "MOVE FUNCTION CURRENT-DATE TO WS-DATA-CHIUSURA", "target": "setCloseDate(LocalDate.now())", "confidence": 99, "description": "Closure date is set to current date"}], "confidenceScores": [{"block": "88-level CHIUSURA-OK/NO → compareTo check", "lines": "31-35", "score": 99}, {"block": "MOVE CLOSED → setStatus", "lines": "22-24", "score": 99}, {"block": "Balance zero validation", "lines": "31-35", "score": 98}]}, {"id": "f6", "confidence": 96.0, "reasonings": ["SLF4J logging replaces DISPLAY because it provides configurable output (file, console, aggregation) without changing code.", "JPA aggregate queries are more efficient than the COBOL pattern of reading every record and accumulating counters."], "sourceCode": "      ******************************************************************\\n      * PROGRAMMA:    ACCTREPT                                         *\\n      * DESCRIZIONE:  Generazione report giornalieri e mensili         *\\n      ******************************************************************\\n       IDENTIFICATION DIVISION.\\n       PROGRAM-ID. ACCTREPT.\\n\\n       DATA DIVISION.\\n       WORKING-STORAGE SECTION.\\n       01  WS-REPORT-DATA.\\n           05  WS-RPT-DATE        PIC X(10).\\n           05  WS-RPT-CONTI-ATT   PIC 9(8) COMP VALUE 0.\\n           05  WS-RPT-TXN-OGGI    PIC 9(8) COMP VALUE 0.\\n           05  WS-RPT-TOT-SALDI   PIC S9(13)V99 COMP-3.\\n           05  WS-RPT-MEDIA-SALDO PIC S9(9)V99 COMP-3.\\n       01  WS-PRINT-LINE.\\n           05  FILLER             PIC X(40).\\n           05  WS-PRT-VALUE       PIC Z(8)9.\\n\\n       PROCEDURE DIVISION.\\n       GENERA-REPORT.\\n           PERFORM CALCOLA-STATISTICHE\\n           PERFORM STAMPA-INTESTAZIONE\\n           PERFORM STAMPA-DETTAGLIO\\n           PERFORM STAMPA-TOTALI\\n           GOBACK.\\n\\n       CALCOLA-STATISTICHE.\\n           OPEN INPUT ACCOUNT-FILE\\n           PERFORM UNTIL WS-EOF\\n               READ ACCOUNT-FILE INTO WS-ACCOUNT-REC\\n               ADD 1 TO WS-RPT-CONTI-ATT\\n               ADD WS-ACCT-BALANCE TO WS-RPT-TOT-SALDI\\n           END-PERFORM\\n           IF WS-RPT-CONTI-ATT > 0\\n               DIVIDE WS-RPT-TOT-SALDI BY WS-RPT-CONTI-ATT\\n                   GIVING WS-RPT-MEDIA-SALDO\\n           END-IF\\n           CLOSE ACCOUNT-FILE.\\n\\n       STAMPA-INTESTAZIONE.\\n           DISPLAY '=== SECB Report Giornaliero ==='.\\n\\n       STAMPA-DETTAGLIO.\\n           DISPLAY 'Conti attivi: ' WS-RPT-CONTI-ATT\\n           DISPLAY 'Transazioni oggi: ' WS-RPT-TXN-OGGI.\\n\\n       STAMPA-TOTALI.\\n           DISPLAY 'Totale saldi: ' WS-RPT-TOT-SALDI\\n           DISPLAY 'Media saldo: ' WS-RPT-MEDIA-SALDO\\n           DISPLAY 'Report completato'.", "sourceFile": "src/ACCTREPT.cbl", "targetCode": "package com.secb.service;\\n\\nimport com.secb.repository.AccountRepository;\\nimport com.secb.repository.TransactionRepository;\\nimport lombok.RequiredArgsConstructor;\\nimport lombok.extern.slf4j.Slf4j;\\nimport org.springframework.stereotype.Service;\\n\\n/**\\n * ACCTREPT — Account Report Service.\\n * Generates daily and monthly reports.\\n * @migrated-from ACCTREPT.cbl\\n */\\n@Slf4j\\n@Service\\n@RequiredArgsConstructor\\npublic class AccountReportService {\\n\\n    private final AccountRepository accountRepository;\\n    private final TransactionRepository transactionRepository;\\n\\n    public void process() {\\n        log.info(\\"Generating daily report\\");\\n        long activeAccounts = accountRepository\\n            .countByStatus(\\"ACTIVE\\");\\n        long todayTransactions = transactionRepository\\n            .countTodayTransactions();\\n\\n        log.info(\\"=== SECB Daily Report ===\\");\\n        log.info(\\"Active accounts: {}\\", activeAccounts);\\n        log.info(\\"Transactions today: {}\\", todayTransactions);\\n        log.info(\\"Report generation complete\\");\\n    }\\n}", "targetFile": "src/main/java/com/secb/service/AccountReportService.java", "linesSource": 45, "linesTarget": 35, "explanations": ["DISPLAY statements converted to structured SLF4J logging with parameterized messages", "Manual file-based statistics computation replaced by JPA count/aggregate queries", "Multiple PERFORM paragraphs collapsed into a single clean method — the report structure is simpler in Java"], "sourceLangId": "cobol", "targetLangId": "java", "businessRules": [{"id": "BR-015", "source": "DISPLAY 'Conti attivi:' WS-RPT-CONTI-ATT", "target": "log.info(\\"Active accounts: {}\\", activeAccounts)", "confidence": 98, "description": "Daily report must show active account count"}, {"id": "BR-016", "source": "WS-RPT-TXN-OGGI", "target": "countTodayTransactions()", "confidence": 97, "description": "Daily report must show today's transaction count"}], "confidenceScores": [{"block": "DISPLAY statements → SLF4J log.info", "lines": "38-47", "score": 97}, {"block": "COMPUTE statistics → JPA count queries", "lines": "27-36", "score": 95}, {"block": "PERFORM structure → single method", "lines": "21-25", "score": 98}]}], "artifacts": {"uiTest": "// No UI tests applicable — backend batch processing service.\\n// API endpoint tests added when REST controllers are implemented.", "docStats": {"pages": 12, "sections": 38, "apiEndpoints": 0}, "unitTest": "package com.secb;\\n\\nimport org.junit.jupiter.api.Test;\\nimport org.junit.jupiter.api.BeforeEach;\\nimport org.junit.jupiter.api.DisplayName;\\nimport static org.junit.jupiter.api.Assertions.*;\\nimport static org.mockito.Mockito.*;\\n\\n@DisplayName(\\"AccountMainService Tests\\")\\nclass AccountMainServiceTest {\\n\\n    private AccountBalanceService balanceService;\\n    private AccountOpenService openService;\\n    private AccountProcessingService processingService;\\n    private AccountReportService reportService;\\n    private AccountMainService mainService;\\n\\n    @BeforeEach\\n    void setUp() {\\n        balanceService = mock(AccountBalanceService.class);\\n        openService = mock(AccountOpenService.class);\\n        processingService = mock(AccountProcessingService.class);\\n        reportService = mock(AccountReportService.class);\\n        mainService = new AccountMainService(\\n            balanceService, openService, processingService, reportService);\\n    }\\n\\n    @Test\\n    @DisplayName(\\"Daily processing executes all services in order\\")\\n    void testDailyProcessingOrder() {\\n        mainService.run();\\n        var order = inOrder(balanceService, openService, processingService, reportService);\\n        order.verify(balanceService).process();\\n        order.verify(openService).process();\\n        order.verify(processingService).process();\\n        order.verify(reportService).process();\\n    }\\n\\n    @Test\\n    @DisplayName(\\"Processing completes without exceptions\\")\\n    void testProcessingCompletes() {\\n        assertDoesNotThrow(() -> mainService.run());\\n    }\\n}", "archStats": {"services": 6, "controllers": 0, "repositories": 4, "configurations": 3}, "uiTestStats": {"cases": 0, "failed": 0, "passed": 0, "coverage": 0}, "documentation": "# SECB Banking System — Migration Documentation\\n\\n## Overview\\nThe SECB (Sistema Elaborazione Conti Bancari) system has been migrated from COBOL-85 to Java 22 with Spring Boot 3.2.\\n\\n## Architecture\\n- **AccountMainService** — Main orchestrator (was ACCTMAIN)\\n- **AccountBalanceService** — Balance calculations (was ACCTBAL)\\n- **AccountOpenService** — Account opening (was ACCTOPEN)\\n- **AccountCloseService** — Account closure (was ACCTCLSE)\\n- **AccountProcessingService** — Transaction processing (was ACCTPROC)\\n- **AccountReportService** — Report generation (was ACCTREPT)\\n\\n## Key Mappings\\n| COBOL | Java |\\n|-------|------|\\n| CALL statement | @Autowired service |\\n| WORKING-STORAGE | Instance fields |\\n| PERFORM | Method call |\\n| PIC 9(n)V99 | BigDecimal |\\n| FILE-CONTROL | JPA Repository |\\n\\n## Testing\\n- 147 unit tests (JUnit 5 + Mockito)\\n- 42 integration tests (SpringBootTest)\\n- 91.4% code coverage", "unitTestStats": {"cases": 147, "failed": 2, "passed": 145, "coverage": 91.4}, "integrationTest": "package com.secb;\\n\\nimport org.junit.jupiter.api.Test;\\nimport org.junit.jupiter.api.DisplayName;\\nimport org.springframework.beans.factory.annotation.Autowired;\\nimport org.springframework.boot.test.context.SpringBootTest;\\nimport org.springframework.test.context.ActiveProfiles;\\nimport static org.junit.jupiter.api.Assertions.*;\\n\\n@SpringBootTest\\n@ActiveProfiles(\\"test\\")\\n@DisplayName(\\"SECB Integration Tests\\")\\nclass SecbIntegrationTest {\\n\\n    @Autowired\\n    private AccountMainService mainService;\\n\\n    @Autowired\\n    private AccountBalanceService balanceService;\\n\\n    @Test\\n    @DisplayName(\\"Spring context loads with all services\\")\\n    void contextLoads() {\\n        assertNotNull(mainService);\\n        assertNotNull(balanceService);\\n    }\\n\\n    @Test\\n    @DisplayName(\\"Full daily processing cycle completes\\")\\n    void testFullCycle() {\\n        assertDoesNotThrow(() -> mainService.run());\\n    }\\n}", "integrationTestStats": {"cases": 42, "failed": 1, "passed": 41, "coverage": 78.2}}}, "verification": {"metrics": {"gates": 8, "passed": 8, "overallScore": 96.8}}, "documentation": {"metrics": {"apis": 0, "pages": 12, "examples": 38}}, "testGeneration": {"metrics": {"coverage": 91.4, "unitTests": 147, "integrationTests": 42}}}, "conversionResult": {"status": "success", "metadata": {"accuracy": 96.8, "iterations": 2, "conversionTime": 2292.4, "linesProcessed": 4820}, "conversionId": "cv-demo-full-001"}, "namingConvention": "camelCase", "preserveComments": true, "selectedDatabase": "postgresql", "selectedPriority": "high", "testingFramework": "junit5", "enableHealthChecks": true, "enableSecurityScan": true, "selectedCompliance": ["gdpr", "sox", "pci"], "architecturePattern": "layered", "confidenceThreshold": 95, "translationStrategy": "semantic", "preserveBusinessLogic": true}
\.


--
-- Data for Name: session; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.session (id, user_id, expires_at, ip_address, user_agent, created_at, updated_at) FROM stdin;
ea641779-b8f2-4183-a4b6-b5f1f856bced	57d169d5-668f-49c3-bb5c-eece800e4839	2026-04-17 21:39:21.62	::1	curl/8.7.1	2026-04-10 23:39:21.621312	2026-04-10 23:39:21.621312
acab5acb-fb10-47db-8686-5852b0cf5b38	dff97699-8a20-4aa7-861c-cbab45111b44	2026-04-17 21:41:25.637	::1	curl/8.7.1	2026-04-10 23:41:25.63809	2026-04-10 23:41:25.63809
791441b2-a095-4c8e-93f0-87a8f1818b12	dff97699-8a20-4aa7-861c-cbab45111b44	2026-04-17 21:41:30.487	::1	curl/8.7.1	2026-04-10 23:41:30.506316	2026-04-10 23:41:30.506316
71a4bf86-caa5-40db-953d-2ea98dd593a4	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-17 22:46:33.351	::1	curl/8.7.1	2026-04-11 00:46:33.352275	2026-04-11 00:46:33.352275
70aa9f1c-6fcd-44e7-bb27-b7c4617c6858	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-18 21:10:02.381	::1	curl/8.7.1	2026-04-11 23:10:02.382878	2026-04-11 23:10:02.382878
ed1df0b0-3188-4d02-9f47-eb142e293dab	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-18 21:12:20.97	::1	curl/8.7.1	2026-04-11 23:12:20.971192	2026-04-11 23:12:20.971192
2d93257f-9418-497e-b522-7dc9e6c9b846	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-18 21:21:37.677	::1	Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36	2026-04-11 23:21:37.678054	2026-04-11 23:21:37.678054
6da61e4d-e41f-4c26-8012-1e7cef47ca8d	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 08:51:50.35	::1	curl/8.7.1	2026-04-12 10:51:50.3521	2026-04-12 10:51:50.3521
0ca165bd-326a-448b-a433-b06f6e30a2c0	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 08:52:00.288	::1	curl/8.7.1	2026-04-12 10:52:00.288773	2026-04-12 10:52:00.288773
aa5c53f2-ab44-46bd-a301-d0b1c19fb4cc	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:02:19.914	::1	curl/8.7.1	2026-04-12 11:02:19.915471	2026-04-12 11:02:19.915471
50f43a15-1631-4b46-a094-04d56cc44967	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:02:40.097	::1	curl/8.7.1	2026-04-12 11:02:40.097749	2026-04-12 11:02:40.097749
20e7429c-cddc-403e-9750-f9e3c9787ada	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:03:51.141	::1	curl/8.7.1	2026-04-12 11:03:51.142087	2026-04-12 11:03:51.142087
5107189c-6a41-4c0d-abe5-1c633b8fb927	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:05:20.943	::1	curl/8.7.1	2026-04-12 11:05:20.944054	2026-04-12 11:05:20.944054
29e6dfb5-64b5-46ed-8414-353b1649dd12	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:05:29.055	::1	curl/8.7.1	2026-04-12 11:05:29.056108	2026-04-12 11:05:29.056108
516d72a7-bada-4100-acf4-ec002a4dc6f6	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:05:40.107	::1	curl/8.7.1	2026-04-12 11:05:40.108083	2026-04-12 11:05:40.108083
eb383e90-9b16-4711-b92d-60f851ba035c	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:20:33.846	::1	curl/8.7.1	2026-04-12 11:20:33.847095	2026-04-12 11:20:33.847095
24076cca-c78f-4d7e-9660-dfe33868b8d5	860eb995-a62d-40a0-a4c0-81912f3b79a1	2026-04-19 09:42:01.252	::1	curl/8.7.1	2026-04-12 11:42:01.252882	2026-04-12 11:42:01.252882
\.


--
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public."user" (id, email, email_verified, name, image, created_at, updated_at) FROM stdin;
860eb995-a62d-40a0-a4c0-81912f3b79a1	demo@scriba.ai	t	Michele Laurelli	\N	2026-04-10 23:32:18.510775	2026-04-10 23:32:18.510775
57d169d5-668f-49c3-bb5c-eece800e4839	test2@scriba.ai	t	Test User	\N	2026-04-10 23:39:21.615052	2026-04-10 23:39:21.615052
dff97699-8a20-4aa7-861c-cbab45111b44	newtest@scriba.ai	t	New Test	\N	2026-04-10 23:41:25.554233	2026-04-10 23:41:25.554233
\.



--
-- Name: project_steps project_steps_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.project_steps
    ADD CONSTRAINT project_steps_pkey PRIMARY KEY (id);


--
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_pkey PRIMARY KEY (id);


--
-- Name: session session_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.session
    ADD CONSTRAINT session_pkey PRIMARY KEY (id);


--
-- Name: user user_email_unique; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public."user"
    ADD CONSTRAINT user_email_unique UNIQUE (email);


--
-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public."user"
    ADD CONSTRAINT user_pkey PRIMARY KEY (id);


--
-- Name: project_steps project_steps_project_id_projects_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.project_steps
    ADD CONSTRAINT project_steps_project_id_projects_id_fk FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;


--
-- Name: projects projects_user_id_user_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_user_id_user_id_fk FOREIGN KEY (user_id) REFERENCES public."user"(id) ON DELETE CASCADE;


--
-- Name: session session_user_id_user_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.session
    ADD CONSTRAINT session_user_id_user_id_fk FOREIGN KEY (user_id) REFERENCES public."user"(id) ON DELETE CASCADE;


--
--

