CLAUDE.md: cautare pe simboluri VFP + corectare flux text in-tree

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5okKjUKMM5Xk1egq2w81P
This commit is contained in:
2026-08-03 08:55:59 +03:00
parent b0ac4ae3b8
commit 67a378ecbf

View File

@@ -26,24 +26,38 @@ Git rulează în paralel cu SVN-ul legacy, nu îl înlocuiește. SVN rămâne su
- Repo-ul principal (rădăcina acestui folder) e propriul lui `.git`, cu remote `git@gitea.romfast.ro:romfast/roagest.git`. `.gitignore` exclude `COMUN/` (gestionat separat, vezi mai jos), `.svn/`, artefactele VFP compilate (`*.fxp`, `*.bak`, `*.mpr`, `*.exe`, …) și fișierele Windows uzuale. - Repo-ul principal (rădăcina acestui folder) e propriul lui `.git`, cu remote `git@gitea.romfast.ro:romfast/roagest.git`. `.gitignore` exclude `COMUN/` (gestionat separat, vezi mai jos), `.svn/`, artefactele VFP compilate (`*.fxp`, `*.bak`, `*.mpr`, `*.exe`, …) și fișierele Windows uzuale.
- `COMUN/` are propriul `.git` separat, cu remote `git@gitea.romfast.ro:romfast/comun.git`**același repo partajat de toate aplicațiile ROA** (ROAACNPRO, ROAIMOB, etc.). O modificare împinsă acolo afectează toate proiectele. Nu face `push --force` peste `comun.git` fără aprobare explicită — ar șterge istoric comun tuturor proiectelor. - `COMUN/` are propriul `.git` separat, cu remote `git@gitea.romfast.ro:romfast/comun.git`**același repo partajat de toate aplicațiile ROA** (ROAACNPRO, ROAIMOB, etc.). O modificare împinsă acolo afectează toate proiectele. Nu face `push --force` peste `comun.git` fără aprobare explicită — ar șterge istoric comun tuturor proiectelor.
- Căutarea în cod VFP binar (`.vcx`/`.scx`) pentru acest proiect folosește `vcx2txt.ps1` parametrizat pentru ROAGEST (vezi secțiunea de mai jos) — cache separat, `D:\ROA\_vfp_textcache\roagest`, nu-l amesteca cu cache-urile altor proiecte. - Căutarea în cod VFP binar (`.vcx`/`.scx`) pentru acest proiect folosește textul `.??2` generat în arbore, lângă fiecare binar (vezi secțiunea de mai jos) — reîmprospătat cu `git_sync.ps1 -ProjectRoot D:\ROA\ROAGEST`, nu un cache separat.
## Searching code inside `.vcx`/`.scx` (binary) libraries ## Searching code inside `.vcx`/`.scx` (binary) libraries
Most class/form code lives **inside binaries** (`.vcx`+`.vct`, `.scx`+`.sct`, …), not in `.prg`, so plain grep can't read it cleanly. To search method/procedure bodies, convert the binaries to their TEXT form first and grep the text, using the shared `foxbin2prg` tool already built at `D:\ROA\UTIL\foxbin2prg\FoxBin2Prg.EXE`: Most class/form code lives **inside binaries** (`.vcx`+`.vct`, `.scx`+`.sct`, …), not in `.prg`, so plain grep can't read it cleanly. Git tracks the **FoxBin2Prg text versions** of these binaries (`.vc2`/`.sc2`/`.fr2`/`.mn2`, plus `.lb2`/`.pj2`/`.dc2`/`.db2`), generated in-tree next to each binary — not the binaries themselves, which are git-ignored. Refresh with `git_sync.ps1` (folder-mode, recursive, incremental):
```powershell ```powershell
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project 'D:\ROA\ROAGEST\roagest.pjx' -ProjectRoot 'D:\ROA\ROAGEST' -CacheRoot 'D:\ROA\_vfp_textcache\roagest' -Types vcx,scx,frx,mnx powershell -ExecutionPolicy Bypass -File D:\ROA\UTIL\foxbin2prg\git_sync.ps1 -ProjectRoot D:\ROA\ROAGEST
``` ```
This reads the file list straight from `roagest.pjx`, so it only converts the `.vcx`/`.scx`/`.frx`/`.mnx` this project actually references — not all of `COMUN\` (most of which is unused by any one app). It's incremental and safe to re-run after IDE edits. Output lands in `D:\ROA\_vfp_textcache\roagest\` as `.vc2`/`.sc2`/`.fr2`/`.mn2` text mirrors — `Grep` those. Run it **at the start of every session and before any `git commit`** so the text matches the binaries. It converts in a temp staging area and copies back only the text, continues past per-file failures, and exits nonzero on any failure: **do not commit while `git_sync` reports unexplained failures.** Then search the `.??2` files in-tree with `Grep` (e.g. `PROCEDURE do_salvare`), citing `file:line`.
For `.vcx`/`.scx`, code edits no longer require the VFP IDE — the flow is now: For `.vcx`/`.scx`, code edits no longer require the VFP IDE — the flow is now:
1. Refresh the cache (`vcx2txt.ps1` above), especially if a VFP IDE session ran since the last refresh (IDE changes make the cache stale). 1. Refresh the in-tree text (`git_sync.ps1` above), especially if a VFP IDE session ran since the last refresh (IDE changes make the text stale).
2. Edit the `.vc2`/`.sc2` text directly (position-sensitive format — don't reflow lines; properties are alphabetized). 2. Edit the `.vc2`/`.sc2` text directly (position-sensitive format — don't reflow lines; properties are alphabetized).
3. Review the diff on the text file like any other source change. 3. Review the diff on the text file like any other source change.
4. Write back with `txt2vcx.ps1` (`D:\ROA\UTIL\foxbin2prg\txt2vcx.ps1 -TextFile <path\to\file.vc2> -ProjectRoot 'D:\ROA\ROAGEST' -CacheRoot 'D:\ROA\_vfp_textcache\roagest'`) — it regenerates and recompiles the binary in a staging folder, fidelity-checks it against the edited text, then copies it into the project only if that check passes. 4. Write back with `txt2vcx.ps1` (`D:\ROA\UTIL\foxbin2prg\txt2vcx.ps1 -TextFile <path\to\file.vc2> -ProjectRoot 'D:\ROA\ROAGEST'`) — it regenerates and recompiles the binary in a staging folder, fidelity-checks it against the edited text, then copies it into the project only if that check passes.
Grep can't tell **which class/method** a hit inside a `.vc2` belongs to (the class header may be thousands of lines above it, and ~2/3 of the file is properties/metadata). `vfp_symbols.ps1` indexes the line range of every class/method/procedure and labels hits with their owner — use it before any `txt2vcx.ps1` edit to get the exact line range of the method you are changing. Its built-in defaults target ROAACNPRO, so always pass ROAGEST's paths:
```powershell
$s = 'D:\ROA\UTIL\foxbin2prg\vfp_symbols.ps1'
$c = @('-CacheRoot', 'D:\ROA\ROAGEST', '-ProjectRoot', 'D:\ROA\ROAGEST', '-IndexFile', 'D:\ROA\_vfp_textcache\roagest\_symbols.tsv')
powershell -ExecutionPolicy Bypass -File $s @c -Grep '<expresie>' -CodeOnly # hits labeled class.method, code only
powershell -ExecutionPolicy Bypass -File $s @c -Where '<fisier>.vc2:<linie>' # who owns this line
powershell -ExecutionPolicy Bypass -File $s @c -Find '<nume>' # where it is DEFINED
powershell -ExecutionPolicy Bypass -File $s @c -Class '<nume_clasa>' # inheritance chain + methods
```
The index (`_symbols.tsv`) rebuilds itself when the text is newer, so refresh the in-tree text first (`git_sync.ps1`) — it can't see IDE edits that were never converted. Full search guide: **`COMUN\docs\cautare_vcx_vct.md`**.
`.mnx`/`.frx` stay **read-only** in this flow (menus still need GENMENU in the IDE; reports are too fragile to round-trip) — edit those in the VFP IDE as before. Targets under `COMUN\` need `-AllowComun` plus explicit approval, since a change there affects every ROA app. See `D:\ROA\UTIL\foxbin2prg\CLAUDE.md` for full details and `COMUN\docs\flux-editare-vfp-text.md` for the shared per-round workflow (baseline backups, review patches, fidelity check) plus the per-project parameters (including ROAGEST's). `.mnx`/`.frx` stay **read-only** in this flow (menus still need GENMENU in the IDE; reports are too fragile to round-trip) — edit those in the VFP IDE as before. Targets under `COMUN\` need `-AllowComun` plus explicit approval, since a change there affects every ROA app. See `D:\ROA\UTIL\foxbin2prg\CLAUDE.md` for full details and `COMUN\docs\flux-editare-vfp-text.md` for the shared per-round workflow (baseline backups, review patches, fidelity check) plus the per-project parameters (including ROAGEST's).
@@ -122,7 +136,7 @@ Preferințele lui Marius pentru sesiunile pe acest proiect:
- **Orchestrare pe misiuni lungi**: niciodată un singur subagent care acumulează context pe multe sarcini înlănțuite — sesiunea principală orchestrează subagenți proaspeți per sarcină (prag: max ~200250k tokens per subagent, apoi handoff + agent nou), cu handoff compact pe disc; regula comună tuturor proiectelor ROA: `COMUN\docs\orchestrare-subagenti.md`. - **Orchestrare pe misiuni lungi**: niciodată un singur subagent care acumulează context pe multe sarcini înlănțuite — sesiunea principală orchestrează subagenți proaspeți per sarcină (prag: max ~200250k tokens per subagent, apoi handoff + agent nou), cu handoff compact pe disc; regula comună tuturor proiectelor ROA: `COMUN\docs\orchestrare-subagenti.md`.
- **Delegare**: modificările de cod de volum/rutină (aplicarea unei propuneri din `docs/propuneri_*.md`, editări pe cache-ul text + write-back, actualizări de documentație, rulări de teste) se deleagă către **subagenți Sonnet care lucrează în background** (team agents — Agent tool cu `model: sonnet`, lane-uri paralele unde e posibil), iar sesiunea principală doar orchestrează și monitorizează: împarte planul pe lane-uri, transmite constatările între agenți, verifică rezultatele (diff, teste, fidelity) și intervine direct doar la deblocări (procese agățate), decizii și verificări. - **Delegare**: modificările de cod de volum/rutină (aplicarea unei propuneri din `docs/propuneri_*.md`, editări pe cache-ul text + write-back, actualizări de documentație, rulări de teste) se deleagă către **subagenți Sonnet care lucrează în background** (team agents — Agent tool cu `model: sonnet`, lane-uri paralele unde e posibil), iar sesiunea principală doar orchestrează și monitorizează: împarte planul pe lane-uri, transmite constatările între agenți, verifică rezultatele (diff, teste, fidelity) și intervine direct doar la deblocări (procese agățate), decizii și verificări.
- **Fără commit fără review**: nu da commit din proprie inițiativă pe modificări de cod — Marius vrea întâi să **vadă diff-ul**. Pentru binarele VFP (`.vcx`/`.scx`), diff-ul lizibil se face pe forma text: regenerează textul din binarul vechi (HEAD din git) cu `vcx2txt.ps1 -Source` și compară-l cu textul editat din cache (`git diff --no-index`). Commit doar după ce Marius confirmă pe diff. - **Fără commit fără review**: nu da commit din proprie inițiativă pe modificări de cod — Marius vrea întâi să **vadă diff-ul**. Pentru binarele VFP (`.vcx`/`.scx`), diff-ul lizibil se vede direct cu `git diff` pe textul `.vc2`/`.sc2` din arbore (rulează întâi `git_sync.ps1`, ca textul să corespundă binarelor). Commit doar după ce Marius confirmă pe diff.
- **Curățenie înainte de commit**: se rulează `powershell -File COMUN\utile\curatenie.ps1` (`-DryRun` doar listează) — șterge patch-urile de review, handoff-urile/planurile de rundă, backup-urile `*.pre_runda*.bak` (proiect, `COMUN`, cache text) și artefactele de test (`screenshots*/`, `uisync*/`, `*.fxp`, `*.err`, loguri), sărind fișierele urmărite de git. Faptul că sunt în `.gitignore` nu le scutește: se șterg de pe disc. Abia apoi commit. - **Curățenie înainte de commit**: se rulează `powershell -File COMUN\utile\curatenie.ps1` (`-DryRun` doar listează) — șterge patch-urile de review, handoff-urile/planurile de rundă, backup-urile `*.pre_runda*.bak` (proiect, `COMUN`, cache text) și artefactele de test (`screenshots*/`, `uisync*/`, `*.fxp`, `*.err`, loguri), sărind fișierele urmărite de git. Faptul că sunt în `.gitignore` nu le scutește: se șterg de pe disc. Abia apoi commit.
## Stil de raspuns: scurt si concret ## Stil de raspuns: scurt si concret