feature: implement functional instrumentation and compatibility metrics#1830
feature: implement functional instrumentation and compatibility metrics#1830RobertvanderHulst merged 3 commits intodevfrom
Conversation
- Decorated 240+ functions with FoxProFunctionsAttribute for formal auditing. - Categorized functions by Engine, Category, Status and Criticality. - Integrated VfpCompatMetrics tool to calculate weighted compatibility scores.
There was a problem hiding this comment.
Pull request overview
This PR introduces a formal instrumentation layer for the Visual FoxPro (VFP) runtime functions and adds a CLI tool that reflects over XSharp.VFP.dll to compute weighted compatibility metrics and detect instrumentation consistency issues.
Changes:
- Added
FoxProFunctionAttribute(+ supporting enums) to encode function metadata (category/engine/status/criticality/notes). - Decorated a large set of VFP runtime functions (including stubs and not-supported functions) with
FoxProFunctionAttribute. - Added a new
VfpCompatMetricsCLI tool/solution to load an assembly, extract metadata, validate it, and print a compatibility report.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tools/VfpTools/XSharp.Vfp.Tools.slnx | Adds a solution wrapper for the new VFP tools project(s). |
| src/Tools/VfpTools/VfpCompatMetrics/VfpCompatMetrics.xsproj | Adds the build project for the new metrics CLI tool. |
| src/Tools/VfpTools/VfpCompatMetrics/Properties/AssemblyInfo.prg | Adds assembly metadata for the new CLI tool. |
| src/Tools/VfpTools/VfpCompatMetrics/Program.prg | Implements assembly loading, attribute extraction, validation, scoring, and console reporting. |
| src/Runtime/XSharp.VFP/XSharp.VFP.xsproj | Includes the new attribute source file and Types folder in the runtime build. |
| src/Runtime/XSharp.VFP/Types/Attributes.prg | Introduces FoxProFunctionAttribute and enums used to instrument runtime functions. |
| src/Runtime/XSharp.VFP/ArrayFunctions.prg | Adds instrumentation attributes to array-related runtime functions. |
| src/Runtime/XSharp.VFP/BitFunctions.prg | Adds instrumentation attributes to bitwise runtime functions. |
| src/Runtime/XSharp.VFP/ClassFunctions.prg | Adds instrumentation attributes to class/object helper runtime functions. |
| src/Runtime/XSharp.VFP/DateFunctions.prg | Adds instrumentation attributes to date/time runtime functions and adjusts nearby comments. |
| src/Runtime/XSharp.VFP/FileFunctions.prg | Adds instrumentation attributes to file/IO runtime functions. |
| src/Runtime/XSharp.VFP/FinancialFunctions.prg | Adds instrumentation attributes to financial runtime functions. |
| src/Runtime/XSharp.VFP/Functions.prg | Adds instrumentation attributes to core object/utility runtime functions. |
| src/Runtime/XSharp.VFP/GetWord.prg | Adds instrumentation attributes to word parsing runtime functions. |
| src/Runtime/XSharp.VFP/Keyboard.prg | Adds instrumentation attributes to keyboard state runtime functions. |
| src/Runtime/XSharp.VFP/MiscFunctions.prg | Adds instrumentation attributes to miscellaneous runtime functions. |
| src/Runtime/XSharp.VFP/NotSupported.prg | Adds instrumentation attributes to explicitly not-supported runtime functions. |
| src/Runtime/XSharp.VFP/NumericFunctions.prg | Adds instrumentation attributes to numeric runtime functions. |
| src/Runtime/XSharp.VFP/PrinterFunctions.prg | Adds instrumentation attributes to printer-related runtime functions. |
| src/Runtime/XSharp.VFP/StringFunctions.prg | Adds instrumentation attributes to string runtime functions and updates some doc comments. |
| src/Runtime/XSharp.VFP/SystemFunctions.prg | Adds instrumentation attributes to system runtime functions. |
| src/Runtime/XSharp.VFP/TextOutPut.prg | Adds instrumentation attributes to text output/merge runtime functions. |
| src/Runtime/XSharp.VFP/UIFunctions.prg | Adds instrumentation attributes to UI-related runtime functions. |
| src/Runtime/XSharp.VFP/WindowFunctions.prg | Adds instrumentation attributes to window-related runtime functions. |
| src/Runtime/XSharp.VFP/ToDo-A.prg | Adds instrumentation attributes to stubbed “A*” functions. |
| src/Runtime/XSharp.VFP/ToDo-B.prg | Adds instrumentation attributes to stubbed “B*” functions. |
| src/Runtime/XSharp.VFP/ToDo-C.prg | Adds instrumentation attributes to stubbed “C*” functions. |
| src/Runtime/XSharp.VFP/ToDo-D.prg | Adds instrumentation attributes to stubbed “D*” functions. |
| src/Runtime/XSharp.VFP/ToDo-EF.prg | Adds instrumentation attributes to stubbed “E/F*” functions. |
| src/Runtime/XSharp.VFP/ToDo-G.prg | Adds instrumentation attributes to stubbed “G*” functions. |
| src/Runtime/XSharp.VFP/ToDo-HI.prg | Adds instrumentation attributes to stubbed “H/I*” functions. |
| src/Runtime/XSharp.VFP/ToDo-KLM.prg | Adds instrumentation attributes to stubbed “K/L/M*” functions. |
| src/Runtime/XSharp.VFP/ToDo-NOP.prg | Adds instrumentation attributes to stubbed “N/O/P*” functions. |
| src/Runtime/XSharp.VFP/ToDo-QR.prg | Adds instrumentation attributes to stubbed “Q/R*” functions. |
| src/Runtime/XSharp.VFP/ToDo-S.prg | Adds instrumentation attributes to stubbed “S*” functions. |
| src/Runtime/XSharp.VFP/ToDo-TUVWX.prg | Adds instrumentation attributes to stubbed “T/U/V/W/X*” functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| VAR nameSet := HashSet<STRING>{} | ||
|
|
||
| FOREACH item AS FoxFunctionMetadata IN data | ||
| // 1. Empty name | ||
| IF String.IsNullOrWhiteSpace(item:Name) | ||
| issues:Add(ValidationIssue{}{ Level := "ERROR", FunctionName := "<Unknown>", Message := "Unnamed attribute in the technical method: " + item:MethodName }) | ||
| ELSE | ||
| // 2. Duplicated names | ||
| VAR upperName := item:Name:ToUpper() | ||
| IF nameSet:Contains(upperName) |
There was a problem hiding this comment.
Duplicate-name detection uses item:Name:ToUpper() with a default HashSet comparer, which is culture-sensitive and can produce incorrect results in some locales (e.g., Turkish-I). Prefer HashSet(StringComparer.OrdinalIgnoreCase) (or ToUpperInvariant) to make the duplicate check stable and deterministic.
| IF args:Length == 0 | ||
| Console.WriteLine("Usage: vfpCompatMetrics <path_to_XSharp_VFP_dll>") | ||
| RETURN 1 |
There was a problem hiding this comment.
The usage text hardcodes an executable name ("vfpCompatMetrics") that may not match the actual built output (currently OutputName=VfpTools). Keep the usage string in sync with the produced exe name to avoid confusing CLI users.
| <Solution> | ||
| <Project Path="VfpCompatMetrics/VfpCompatMetrics.xsproj" Type="aa6c8d78-22ff-423a-9c7c-5f2393824e04" Id="e3bdfa61-2018-4dd7-8a02-c053bb73ede2" /> | ||
| </Solution> |
There was a problem hiding this comment.
The .slnx file omits the standard and structure used by other .slnx solutions in this repo (e.g., src/RuntimeNet8.slnx). If the build/IDE tooling expects those sections, this minimal form may not load or build correctly; consider aligning this file’s structure with the existing .slnx format.
| <RunPostBuildEvent /> | ||
| </PropertyGroup> | ||
| </Project> No newline at end of file |
There was a problem hiding this comment.
This .xsproj is missing the / block that all other Tools .xsproj files include (and which is annotated as required). Without it, solution/project configuration discovery may break in MSBuild/VS; add the same ProjectExtensions block used in other tool projects.
| [assembly: AssemblyTitle("VfpTools")] | ||
| [assembly: AssemblyDescription("")] | ||
| [assembly: AssemblyConfiguration("")] | ||
| [assembly: AssemblyCompany("")] | ||
| [assembly: AssemblyProduct("VfpTools")] |
There was a problem hiding this comment.
Assembly metadata (AssemblyTitle/Product) is set to "VfpTools" even though this project is VfpCompatMetrics. This will make the produced assembly/exe identity misleading in file properties and logs; consider using "VfpCompatMetrics" consistently.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| // 7. CLI entry poitn | ||
| // ========================================================================= |
There was a problem hiding this comment.
Typo in comment: "CLI entry poitn" → "CLI entry point".
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@RobertvanderHulst I've opened a new pull request, #1831, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@RobertvanderHulst I've opened a new pull request, #1832, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@RobertvanderHulst I've opened a new pull request, #1833, to work on those changes. Once the pull request is ready, I'll request review from you. |
Overview
This PR introduces a formal Functional Instrumentation and Metric System for the Visual FoxPro dialect. The goal is to move away from ad-hoc progress estimates and provide a data-driven, weighted measurement of the VFP Runtime's compatibility.
Key Changes
FoxProFunctionAttribute. This metadata includesCategory,Engine,StatusandCriticality.TABLEUPDATE(),ALLTRIM()) impact the compatibility score more significantrly than fringe utilities.src/Tools/VfpToolsthat performs reflection-based audits onXSharp.VFP.dllgenerating detailed reports on progress, thecnical debt and consistency errors like duplicated names.Current instrumentation shows an initial 50.54% weighed compatibility score providing a clear baseline for future sprints.