feat(scripts): grafo de subsistema do ERP padrão + fechamento em N hops - #3
Merged
Merged
Conversation
… closure `scripts/csw_grafo_modulo.py CCT --versao 8.1` graphs a subsystem of the standard ERP the same way the client script graphs a customization: scope by module prefix inside a version tree, then close by dependency. `CCT` covers the 99 `rotinas/CCT*` directories of 8.1 -- 11,386 routines, the textile subsystem -- and produced 360,905 nodes / 1,144,309 edges with 1.5% of edges left on stubs, in 315s. Classes are not pulled in by a name rule. The routine->package mapping is irregular (`CCTCO` has `classescls/TCo`, `CCTTGT` has no `TTgt`), so guessing loses classes that exist and invents packages that do not. The closure decides instead: a class enters when the module's code references it, which is also the only case where it matters to this graph. Shared machinery moved to `scripts/csw_grafo_comum.py`, which both entry points now use. Two fixes fall out of that: - The closure was missing the `cswcore` tree. 8.1 ships `csw81` AND `cswcore81` as sibling trees (the `DD*` routines live there); indexing only `csw<vv>` left 35 names on stubs for client CO with no reason. - Components tree was being derived from the version tree's pomcs.xml, which disagrees with the client's: `7.5/csw75/pomcs.xml` asks for cswutil 8.0.21 while `custom/gb/pomcs.xml` asks for 7.0.130. Mixing ERP 7.5 with 8.0 components would have been wrong in silence -- routine names exist in both trees, so the closure would "close" against the wrong version and nothing would fail. The client's pomcs now wins, family convention is the fallback, and a disagreement is printed with the `--comp` override. `--hops N` (default 1) runs the closure repeatedly. What improves is the ratio, not the absolute count: each level resolves what the previous asked for, and the files it brings have their own frontier. Client GB: hop 1 = 949 files and 4.7% on stubs, hop 2 = 2,038 files and 2.9%, edges 94k -> 221k. Large standard subsystems are the opposite trade -- textile 8.1 went 1.5% -> 1.4% for 5min -> 74min -- so the default stays 1 and the README says which case each suits. The residue never reaches zero and that is not a defect: `*zzz` names are the framework's version placeholders (`$$ver^CCTCzzz`, 4,767 edges in textile alone) and exist in no tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pedido: grafo do sistema têxtil da 8.1 (
rotinas/CCT*). Entregue como um irmão do script de cliente, com a mesma mecânica de fechamento.O que entra
CCT= os 99 diretóriosrotinas/CCT*da 8.1, 11.386 rotinas. Resultado: 360.905 nós, 1.144.309 arestas, 1,5% em stub, 315s (399 MB). Sai em<out>\8.1-CCT.Validado no
CCTTGT010.mac: 254 nós, 641 chamadas saindo e 61 entrando, atravessandoCCTAD→CCTTGT,CCCGI,CCFTe os componentes emCOMP-8.0.Classes não entram por regra de nome — o mapeamento é irregular (
CCTCOtemclassescls/TCo,CCTTGTnão temTTgt). Quem decide é o fechamento.--hops N(padrão 1)O que melhora é a proporção, não o absoluto: cada nível resolve o que o anterior pediu, e os arquivos novos têm a própria fronteira.
Ou seja: hop 2 vale para cliente pequeno, não vale para subsistema padrão grande. O padrão fica 1 e o README diz qual caso é qual.
Duas correções que essa tarefa expôs
Faltava o
cswcore. A 8.1 temcsw81ecswcore81como árvores irmãs (as rotinasDD*vivem lá); o fechamento indexava sócsw<vv>. Isso deixava 35 nomes em stub no CO sem necessidade.cswutildivergente entre fontes.7.5/csw75/pomcs.xmlpedecswutil 8.0.21;custom/gb/pomcs.xmlpede7.0.130. Misturar ERP 7.5 com componentes 8.0 passaria batido — os nomes de rotina existem nas duas árvores, então o fechamento "fecharia" contra a versão errada e nada falharia. Agora o pomcs do cliente manda, a convenção de família é fallback, e a divergência é impressa:Nota de review
Os
*zzz(CCTCzzz,%CSzzz— 4.767 arestas só no têxtil) nunca resolvem e não são falha: são os placeholders de versão do framework ($$ver^<MODULO>zzz), que não existem como arquivo. Documentado nofechar()e na skill.Não incluí as alterações em
graphify/extract.pyetests/test_zero_node_no_cache.pyque estão na working tree desta máquina (cache de resultadoskipped, issue Graphify-Labs#2258) — são de outra frente e não são minhas.