Files
roaauto/CLAUDE.md

94 lines
6.7 KiB
Markdown

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## What this is
ROAAUTO is a **Visual FoxPro 9** desktop application (Romanian-language) for auto-service /
car-dealer operations: devize (quotes/estimates), comenzi (work orders), facturare (invoicing).
It is one member of the larger "ROA" suite and shares the `COMUN\` framework with the other
ROA applications (ROAACNPRO, ROAGEST, etc.).
## Build, run, version control
- **Build/run requires the Visual FoxPro 9 IDE on Windows.** There is no command-line build.
Open `roaauto.pjx` in the VFP IDE and use *Build > Build Executable* to produce `roaauto.exe`.
- **`.prg` files are source; `.fxp` are compiled, `.bak` are backups.** Edit the `.prg`. The
`.scx/.sct` (forms), `.vcx/.vct` (class libraries), `.frx/.frt` (reports), and `.mnx/.mpr`
(menus) are VFP binary/generated artifacts — **edit them in the VFP IDE, not by hand.**
- **Version control: git runs in parallel with the legacy SVN.** SVN (`.svn/`) remains the "live"
source of truth for this project and especially for `COMUN/`, which stays a working copy
synced manually to git — git does not replace it, just mirrors it for tooling (search, diffing,
agent workflows). Don't run `svn` commands from here unless explicitly asked; `.gitignore`
simply excludes `.svn/`.
- **Repo principal** (rădăcina acestui folder): `git@gitea.romfast.ro:romfast/roaauto.git`.
- **`COMUN/`** are propriul `.git`, separat de repo-ul principal (de aceea `COMUN/` e în
`.gitignore`-ul de la rădăcină — nu e tracked de repo-ul principal). Origin-ul lui e
**același pentru toate aplicațiile ROA**: `git@gitea.romfast.ro:romfast/comun.git` — repo
partajat, populat inițial din ROAACNPRO. Nu face force-push peste el fără să verifici întâi
diferențele față de `origin/main` (ar afecta toate proiectele ROA care îl folosesc).
- **`config.fpw`** sets the runtime environment. Don't enable SAFETY — the code relies on silent
overwrite (see `EXCLUSIVE=OFF`/`SAFETY=OFF` conventions shared across ROA apps).
- The compiler error log is `roaauto.ERR`; the runtime log is `LOG.txt`.
## Searching code inside `.vcx`/`.scx` (binary) libraries
Git tracks the **FoxBin2Prg text versions** of the VFP binaries (`.vc2/.sc2/.fr2/.mn2/.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 -ExecutionPolicy Bypass -File D:\ROA\UTIL\foxbin2prg\git_sync.ps1 -ProjectRoot D:\ROA\ROAAUTO
```
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`.
Editing: write-back text→binary via `txt2vcx.ps1` is supported **only for `.vc2/.sc2`** (vcx/scx);
`.frx/.mnx/.lbx/.pjx/.dbc/.dbf` are editable **only in the VFP IDE** (no write-back). See
`D:\ROA\UTIL\foxbin2prg\CLAUDE.md` and `COMUN\docs\flux-editare-vfp-text.md`.
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 this project's paths:
```powershell
$s = 'D:\ROA\UTIL\foxbin2prg\vfp_symbols.ps1'
$c = @('-CacheRoot', 'D:\ROA\ROAAUTO', '-ProjectRoot', 'D:\ROA\ROAAUTO', '-IndexFile', 'D:\ROA\_vfp_textcache\roaauto\_symbols.tsv')
powershell -ExecutionPolicy Bypass -File $s @c -Grep '<expression>' -CodeOnly # hits labeled class.method, code only
powershell -ExecutionPolicy Bypass -File $s @c -Where '<file>.vc2:<line>' # who owns this line
powershell -ExecutionPolicy Bypass -File $s @c -Find '<name>' # where it is DEFINED
powershell -ExecutionPolicy Bypass -File $s @c -Class '<class name>' # inheritance chain + methods
```
The index (`_symbols.tsv`) rebuilds itself when the text is newer, so refresh the text first — it
can't see IDE edits that were never converted. Full search guide: `COMUN\docs\cautare_vcx_vct.md`.
## The COMUN shared framework
`COMUN/` is shared, framework-level code used by every ROA app — not specific to ROAAUTO. Treat
it as a vendored library: prefer app-specific changes in this repo's top-level `Programe/`,
`Clase/`, `Ferestre/`, `Rapoarte/`, `Meniuri/` directories, and only touch `COMUN/` when the fix
genuinely belongs to the shared framework (and remember it's versioned separately, shared with
every other ROA app).
## Mod de lucru: delegare către subagenți + review înainte de commit
Preferințele lui Marius pentru sesiunile pe acest proiect:
- **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 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.
- **Arată diff-ul complet după orice modificare**: după ce agenții (proprii sau subagenți) termină o rundă de editări — inclusiv la asamblarea rezultatelor din lane-uri paralele — afișează-i lui Marius diff-ul complet (`git diff`, nu doar rezumat/`--stat`) înainte de a continua la pasul următor sau de a cere aprobare, nu doar un sumar descriptiv al schimbărilor.
## Project insights (docs/)
Vezi indexul din [`docs/README.md`](docs/README.md). Oferă-mi proactiv actualizarea `docs/`
ori de câte ori descoperi un insight nou și ne-evident despre acest proiect (flux ascuns,
capcană, convenție, procedură/pachet cheie, tabel relevant) — nu aștepta să fii întrebat.