-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappsettings.json
More file actions
188 lines (188 loc) · 9.15 KB
/
Copy pathappsettings.json
File metadata and controls
188 lines (188 loc) · 9.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
"Logging": {
"File": {
"Directory": "C:\\inetpub\\wwwroot\\layoutparser\\api\\logs",
"FileName": "layoutparserapi.log",
"RetainedFileCountLimit": "10",
"FileSizeLimitKB": "2049"
},
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AiMetrics": {
"IngestApiKey": ""
},
"Security": {
"TrustedUserHeader": "x-iis-user",
"TrustedRolesHeader": "x-iis-roles"
},
"Authentication": {
"ServiceClient": {
"_comment": "ADR M2M (docs/architecture/adr-autenticacao-m2m-e2e-cypress-2026-09-03.md). Authority/Audience são metadados públicos de config OIDC, não segredo. App Registration 'de serviço' provisionado em 2026-09-06 no mesmo tenant Entra usado pelo BFF (LayoutParserReact) — API=LayoutParserApi (resource, App Role Service.E2E), client=LayoutParserE2EClient (consumidor M2M, client_secret nunca chega aqui, fica só do lado do Cypress/CI). Audience é o Client ID puro (GUID), NÃO o Application ID URI api://<guid>: o App Registration está com accessTokenAcceptedVersion=2 (requestedAccessTokenVersion no manifest), e token de acesso v2 do Entra traz aud = GUID do recurso, não o URI. O identifierUris continua api://<guid> (é o que o consumidor pede como scope /.default), mas o aud validado aqui é o GUID. Reteste Cypress 2026-09-10: iss/ver v2 OK apos manifest; IDX10214 (audience) resolvido por esta troca.",
"Authority": "https://login.microsoftonline.com/8de72b5f-31a7-44aa-831e-d60750ab55d7/v2.0",
"Audience": "f76c2598-4759-48a9-8145-8a967ec7ac96"
}
},
"Cors": {
"AllowedOrigins": "http://172.25.32.42:81,http://localhost:81,http://localhost:8080,http://172.25.32.42:80,http://localhost:80,http://127.0.0.1:81,http://127.0.0.1:8080"
},
"Ollama": {
"_comment": "Url aponta pra VM Ubuntu dedicada (172.25.32.5), onde o Ollama de fato roda — nao co-localizada com a API (Windows Server). Model trocado em 2026-09-07 para o adapter LoRA fine-tuned (Qwen2.5-Coder-1.5B-Instruct + dataset sysmiddle-dsl, merge+GGUF+Q4_K_M), registrado como layoutparser-sysmiddle-dsl:1.5b — testado em 4 cenarios reais (copy/concat/conditional/lookup) contra deepseek-coder:6.7b (nunca existiu nesse Ollama — config anterior estava quebrada silenciosamente) e qwen2.5-coder:7b (generico, 4.7GB): o especializado venceu em todos, mesmo nos casos fracos.",
"Url": "http://172.25.32.5:11434",
"Model": "layoutparser-sysmiddle-dsl:1.5b",
"DiagnosisTimeoutSeconds": 60
},
"AiTransformationCandidate": {
"MaxIterations": 3,
"SanityTimeoutMinutes": 45,
"TicketTtlHours": 72,
"CleanupIntervalMinutes": 60
},
"XslSynth": {
"Retraining": {
"_comment": "F4 (issue #351) — retraining automatizado do modelo fine-tuned. Enabled=false por padrao: o disparo real de train_lora.py e o retraining.lock fisico dependem de fiacao no cron/script da VM 172.25.32.5 (handoff @lp-devops). Com Enabled=false a API so mantem o contador de exemplos novos (F3) e checa o lock se o arquivo aparecer. TriggerFilePath/LockFilePath/StateFilePath caem, por padrao, na arvore de XslSynth:TrainingDataPath.",
"Enabled": false,
"NewExampleThreshold": 300,
"MaxDaysBetweenTrainings": 90,
"EvaluationIntervalHours": 6,
"StaleLockAfterHours": 60
}
},
"RAG": {
"ExamplesPath": "Exemplos",
"RulesPath": "Data/Rules"
},
"Examples": {
"Path": "C:\\inetpub\\wwwroot\\layoutparser\\Exemplo"
},
"Learning": {
"BasePath": "C:\\inetpub\\wwwroot\\layoutparser\\Exemplo"
},
"ReferenceExamples": {
"BasePath": ""
},
"XsdValidation": {
"BasePath": "C:\\inetpub\\wwwroot\\layoutparser\\xsd",
"PdfBasePath": "C:\\inetpub\\wwwroot\\layoutparser\\pdf",
"DocumentTypes": {
"NFe": {
"XsdVersion": "PL_010b_NT2025_002_v1.30",
"Namespace": "http://www.portalfiscal.inf.br/nfe",
"RootElement": "NFe"
},
"CTE": {
"XsdVersion": "PL_CTe_300",
"Namespace": "http://www.portalfiscal.inf.br/cte",
"RootElement": "CTe"
},
"NFCom": {
"XsdVersion": "PL_NFCom_100",
"Namespace": "http://www.portalfiscal.inf.br/nfcom",
"RootElement": "NFCom"
},
"MDFe": {
"XsdVersion": "PL_MDFe_300",
"Namespace": "http://www.portalfiscal.inf.br/mdfe",
"RootElement": "MDFe"
}
}
},
"TransformationRules": {
"Path": "C:\\inetpub\\wwwroot\\layoutparser\\TransformationRules"
},
"TransformationPipeline": {
"TclPath": "C:\\inetpub\\wwwroot\\layoutparser\\tcl",
"XslPath": "C:\\inetpub\\wwwroot\\layoutparser\\xsl",
"MappingPath": "C:\\inetpub\\wwwroot\\layoutparser\\Mapeamentro",
"ExamplesPath": "C:\\inetpub\\wwwroot\\layoutparser\\Examples",
"ExamplesTclPath": "C:\\inetpub\\wwwroot\\layoutparser\\Examples\\tcl",
"ExamplesXslPath": "C:\\inetpub\\wwwroot\\layoutparser\\Examples\\xsl",
"LearningModelsPath": "C:\\inetpub\\wwwroot\\layoutparser\\LearningModels",
"ExpectedOutputsPath": "C:\\inetpub\\wwwroot\\layoutparser\\ExpectedOutputs",
"LearningExamplesPath": "C:\\Users\\Elson\\source\\repos\\ExemplosDeXSLeTCL"
},
"Database": {
"_comment": "Senha real via dotnet user-secrets (dev) ou env var Database__Password (prod) - nunca em texto plano neste arquivo (ver .claude/rules/security.md).",
"Server": "172.31.249.51",
"Database": "ConnectUS_Macgyver",
"UserId": "macgyver",
"Password": "",
"Encrypt": "false",
"ConnectionTimeout": "30",
"CommandTimeout": "30"
},
"IdentityDatabase": {
"_comment": "Banco DEDICADO da LayoutParserApi (identidade/workspace/pacotes fiscais/drafts/releases) - NAO e o ConnectUS_Macgyver. SQL Server rodando em Docker na VM Ubuntu de producao (elson@172.25.32.5, container 'layoutparser-identity-sql', mcr.microsoft.com/mssql/server:2022-latest, porta publicada 1433 - CONFIRMAR com o dono se a porta publicada do container e realmente 1433:1433 e nao outra mapeada; nao foi possivel inspecionar o container diretamente). O valor anterior ('localhost\\SQLEXPRESS') era um resquicio de configuracao local de dev (ver commit 0a2162b) - nunca foi atualizado para producao. Credencial separada da do Sysmiddle: nunca reusar Database:Password aqui. Senha real via dotnet user-secrets (dev) ou env var IdentityDatabase__Password (prod) - nunca em texto plano neste arquivo (ver .claude/rules/security.md).",
"Server": "172.25.32.5,1433",
"Database": "LayoutParserIdentity",
"UserId": "",
"Password": "",
"ConnectionTimeout": "30",
"CommandTimeout": "30"
},
"Redis": {
"ConnectionString": "localhost:6379",
"Database": 0
},
"LayoutParserDecrypt": {
"Path": "C:\\inetpub\\wwwroot\\layoutparser\\api\\LayoutParserDecrypt.exe"
},
"LayoutValidation": {
"DailyValidationTime": "02:00",
"InitialValidationLayouts": [
"79adf76a-4b07-428c-90d7-3c39d1296a5d",
"e339073e-32d1-492e-ae8a-dcf6337b21a1",
"ad4fb6f4-9ff5-44fd-988b-3da5ed56b22c",
"2c5d031d-0405-466e-9ce1-f37ff2b148d5",
"8eaa49f1-fd95-4588-b9fe-198a089d8529"
]
},
"ML": {
"LearningDataPath": "C:\\inetpub\\wwwroot\\layoutparser\\MLData",
"LowCodeTransformationsPath": "C:\\inetpub\\wwwroot\\layoutparser\\MLData\\LowCodeTransformations"
},
"StructuralResolution": {
"NfeSchemaPath": "",
"NfeRootElementName": "NFe"
},
"LowCode": {
"RunnerPath": "C:\\inetpub\\wwwroot\\layoutparser\\api\\lowcode-runner\\LayoutParserLowCodeRunner.exe",
"SysmiddleDir": "C:\\inetpub\\wwwroot\\layoutparser\\sysmiddle",
"GlobalFolder": "C:\\inetpub\\wwwroot\\layoutparser\\globalfolder",
"Package": "938f9978-836f-48c1-9c0f-c2898caf4b20",
"DefaultMapperName": "",
"ProjectId": 2,
"MultiCandidateTopN": 4,
"RunnerTimeoutSeconds": 180,
"MaxConcurrentRunners": 2,
"SyncDeliveryTimeoutSeconds": 6,
"CandidatesRequestTimeoutSeconds": 90,
"InlineXmlMaxChars": 262144,
"TransformationCacheTtlHours": 2,
"AllowedPackageGuids": [
"PAC_266bc578-b0fa-48a4-9c72-61004b729576",
"PAC_9817e955-2c20-492a-a9a0-e2094418a5fe",
"PAC_36f1d551-06fb-4abc-80cc-aa565f4a258e",
"PAC_3cd8b69a-60cf-49b1-87eb-2124dc861f3d",
"PAC_297cd148-c565-4192-833f-d5c9c9318114",
"PAC_e025e083-7e83-46b1-a327-203c3773863f",
"PAC_99657a66-274f-498d-bea3-ad576ddeed1c",
"PAC_95d6a87a-8806-495e-91fa-e7c6f96ba065",
"PAC_d5ab3e0f-f79b-41d8-809f-6c0afc8e8291",
"PAC_c1c9b0c4-8b78-47fe-ab28-f00a0359bffd",
"PAC_d13c343b-3852-4a21-9239-cfdd297c4557",
"PAC_1bac3832-ebba-4553-9582-2f874934a80c"
]
},
"AllowedHosts": "*",
"Kestrel": {
"_comment": "Só Http — a API roda loopback-only atrás do BFF (ver security.md), sem terminação HTTPS nesta camada. O endpoint Https foi removido em 2026-09-07: nunca tinha chegado no servidor de produção (appsettings.json era preservado, não versionado, até a migração da issue #112) e, ao chegar pela primeira vez, derrubou o boot em crash-loop — 'Unable to configure HTTPS endpoint. No server certificate was specified' (não há certificado configurado em produção). Não reintroduza sem provisionar certificado real.",
"Endpoints": {
"Http": {
"Url": "http://127.0.0.1:5000"
}
}
}
}