FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antigravity to help you with FWH
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Antigravity to help you with FWH
Posted: Fri Mar 06, 2026 02:36 PM

Once you install FWH at c:\FWH or similar, run Google Antigravity and select the folder c:\FWH or where FWH has been installed.

From that moment on you may ask Antigravity anything about the FWH code, examples, code explanations, to build new examples, etc.

You should give it a try :wink: :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Antigravity to help you with FWH
Posted: Fri Mar 06, 2026 04:08 PM

Dear Antonio, thank you once again very warmly for the tip and for your persistence in encouraging us to finally start with Antigravity, or more generally with agentic software development. In the end, the installation was truly not that difficult at all. Here is my first result: I had the microservice examined thoroughly, especially with regard to the use of the Harbourino style during development and in the evaluation.

Now, of course, I first need to familiarize myself with how to use the program and see how well it fits in with my other workflows, but I think I’ll manage.

Best regards, Otto

The structure you have outlined reveals a fascinating architectural concept: the project quite obviously uses Harbourino as a code assembler, preprocessor, or snippet manager.

With Harbourino, the source code is not maintained as one huge, confusing monolithic .prg file, but instead split into atomic, logical building blocks (snippets). At compile time, Harbourino pulls these building blocks together (marked by placeholders or comments such as //-- HARBOURINO HB_MAIN --//) and generates the actual compilable Harbour code.

From this perspective, the architecture can be analyzed excellently. It is broadly divided into two worlds:

Harbour level (business logic & locking) C level (BEGINDUMP) (low-level web server & sockets)

Here is the analysis of the project based on the Harbourino building blocks you mentioned:

Harbour level (business logic & state) -> HB_MAIN The main entry point of the compiled application (FUNCTION Main()). Hierarchically, this is the framework from which constants are loaded, the audit directory is initialized, and finally the HTTP server written in C is started.

The locking & sweep mechanism Since traditional DBF databases are used, conflict management is extremely important, especially when access happens via web/API (statelessness). The following snippets handle concurrent access to bookings ("record locks" with a time limit):

-> ACQUIRE_GUARD_SWEEP_SETZEN: Sets a guard. When a user/client reserves a resource, a lease timer is set. -> GUARD_LOCKS_DBF: Handles the central table (LOCKS.DBF), which records who is currently editing which room/which booking. -> RELEASE_IDEMPOTENT: Cleanly releases a lock again (idempotent means that even if it is called multiple times, nothing crashes). -> SWEEP_STATUS / -> LOCKSTATUS: A garbage collection (sweep) for locks. If a client crashes (for example, the browser is closed), locks do not remain stuck forever after the lease time expires, but are recognized and deleted by the "sweeper." -> F_DB_API: API layer for database operations. Presumably core routines such as opening DBFs, searching, and pagination, which are used by the various endpoints. -> CONVERTUMLAUTE: Converts umlauts between systems (presumably ANSI / Code Page 850 / DEWIN to UTF-8 for clean JSON in the web frontend).

C level (#pragma BEGINDUMP ... #pragma ENDDUMP) This is where Harbour shows its greatest strength: native embedding of C code. Since Harbour itself does not have a built-in high-performance multithreading HTTP server for modern web APIs, one was implemented here directly and efficiently on top of the Windows Socket API (Winsock) in pure C. Harbourino logically assembles the C functions:

Helper functions & utilities:

-> INCLUDEFILES_C: Loads C header files (<winsock2.h>, <stdio.h>, etc.). -> HELPERS_4_HTML / -> HF_LOGGING: Generates HTML output for error pages and provides C logging functionality. -> SHELL_EXECUTE: A C wrapper for the Windows API ShellExecute in order to call external programs (such as checkweb.exe).

Security & routing:

-> CRYPTACQUIRECONTEXT: Calls Windows crypto APIs (often used for random numbers, nonces, or SSL). -> GETPVPROFSTRING / -> HELPER: Reads, for example, INI files or contains string utilities for C. -> GET_HEADER_VALUE_CI: Case-insensitive reading of HTTP headers (for example Authorization: or Content-Type:). -> G_EXPECTED_TOKEN / -> IS_TOKEN_OK / -> ROUTE_NEEDS_AUTH: This is the authentication middleware. Before an API call reaches the hotel API, it is checked whether the route is protected and whether the supplied bearer token is valid.

HTTP & JSON response architecture:

-> SEND_ALL: Ensures that large TCP packets are sent completely to the socket (prevents truncated JSON output). -> ADD_CORS_HEADERS: Adds Access-Control-Allow-Origin: * so that browser applications can access the backend across different domains (Cross-Origin Resource Sharing). -> BUILDANDSENDJSONRESPONSE / -> F_BUILDJSONRESPONSE: Takes the JSON string generated in Harbour, wraps it in a valid HTTP 1.1 header (200 OK, Content-Length), and sends it to the client through the socket.

The heartbeat: HB_FUNC( STARTHTTPSERVER ) This is the main loop of the C server, called from the Harbour level. Harbourino builds this function step by step like Lego:

-> WSASTARTUP: Initializes the Windows Socket API. -> SOCKET_CREATE / -> PORT_BIND / -> LISTENSOCKET: Creates the TCPv4 socket, binds it to a port (for example 80 or 8080), and puts it into listening mode.

The main loop (while (1)) (synchronous blocking):

-> ACCEPT: Waits until a browser/client connects. -> READ_REQUEST / -> REQUESTLINE: Reads the raw HTTP traffic and parses, for example, POST /api/customers HTTP/1.1. -> ROUTER: (The core component) Takes the extracted HTTP URL and forwards it in C via hb_itemDoC() to the Harbour functions (for example to HANDLE_READRECORD_CUSTOMERS). -> CLIENTSOCKET_RESPONSE: Takes the return value from Harbour routing and sends it. -> SHUTDOWN_CLIENTSOCKET / -> SO_LINGER / -> CLOSESOCKET: Ends the transaction. SO_LINGER ensures that any TCP packets still in flight leave the system cleanly before the socket is forcibly closed. -> CLOSEMAINSOCKET / -> WINSOCKET_CLEAN: In the event of a server shutdown, memory is released again.

Conclusion on the Harbourino approach The code uses Harbourino extremely intelligently as an architectural tool: the C part of the HTTP server (STARTHTTPSERVER) would normally be horrible spaghetti code in C. Harbourino breaks the C code down into digestible, reusable blocks (socket init, auth, router, teardown). At the same time, on the Harbour side it provides a clean interface concept (controller functions) so that the business logic (locking, DBF read/write operations, umlauts) can be programmed completely separately from the TCP/IP low-level details.

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Antigravity to help you with FWH
Posted: Fri Mar 06, 2026 05:34 PM

Dear Antonio, thank you again for the tip about Antigravity. What stands out to me most positively is that Antigravity speaks of “our” code. Most AIs generate code and then treat it as if it were simply “your” code. That subtly creates a certain sense of separation, almost a feeling of opposition.

Best regards, Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Fri Mar 06, 2026 05:38 PM

Dear Otto,

Antigravity is really so good! :!: :idea:

The more you use it, the more power you get :D

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Antigravity to help you with FWH
Posted: Sat Mar 07, 2026 01:28 AM

I installed Anti-Gravity previously. I probably didn't configure it right. Perhaps you can be specific.

FiveWin is in the C:\FWH64 folder My source code is in the C:\Projects\MLS2026\Source folder

Anti-Gravity has many options. So I would like to have it reference the FWH64 code, etc, to analyze specific .prg files in my application source code.

1). What mode of Anti-gravity should I be using ? 2). How do I have it point to both folders to reference everything ? 3). What else should I configure in Anti-gravity to work on this.

Maybe I've been spending too much time out working in the sunshine, and not enough on the computer.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Sat Mar 07, 2026 05:05 AM

Dear Tim,

1). What mode of Anti-gravity should I be using ?

Not sure what you mean here. The standard one. There are no others (?)

2). How do I have it point to both folders to reference everything ?

You select the folder C:\Projects\MLS2026\Source, then click on "Add folder to workspace..." and select C:\FWH64

3). What else should I configure in Anti-gravity to work on this.

Sometimes I experience failings in cmd executions. Not sure if you and others have experienced this. If so, in the agent window (right panel) click on the horizontal "..." option. Then click on "Customization". Basically you edit Users\<username>\.gemini\GEMINI.md then add this:

# Terminal Stability & Completion Rules

  1. Non-Interactive Mode: Always use flags that bypass prompts (e.g., -y, --yes, --force, --quiet). Never run commands that require manual user input.
  2. Explicit Termination: For Windows environments, execute commands via cmd /c to ensure the process sends a clear exit signal upon completion.
  3. No Paging: Disable output pagers like less or more (e.g., use git --no-pager log instead of git log).
  4. Newline Enforcement: Every terminal string must terminate with an explicit \n character to trigger execution immediately.
  5. Background Processes: Do not attempt to run persistent servers (like npm start) in the primary agent terminal. Use a separate background task if required.

I am also testing these on settings:

"terminal": {
"strictExitDetection": true,
"nonInteractive": true
},
"agent": {
"commandTimeout": 120
},

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: Antigravity to help you with FWH
Posted: Sat Mar 07, 2026 06:54 PM

what about privacy with Antigravity? Is it safe giving access to folders?

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 01:20 AM

Antonio,

On Startup it gives me 3 options, so I select Open Folder, and then Add FWH64.

Now it gives me 3 options: Switch to Agent Manager Code with Agent Edit code inline

I want it to analyze and suggest revisions to a .prg file. ( The project is far too big for it to analyze the whole thing ). Let's use as an example, mInventory.prg. I can click on it and it shows the code editor ....

So how do I now use it to review and suggest code refinements ?

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 08:56 PM

Dear Tim,

Once you have launched Antigravity where your code is, and added the FWH folder too, just go to the chat (right panel) and ask:

"Please analyze mInventory.prg, please review it and suggest code refinements."

Just read and ask, make suggestions, etc. Guide it as you may want it.

It is simply incredible... :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 08:58 PM
chiaiese wrote:

what about privacy with Antigravity?
Is it safe giving access to folders?

100% secure, a professional and great google product :!:

Anyhow, experiment it yourself, enjoy it more and more :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 09:15 PM

here is Gemini answer:

When it comes to Antigravity, privacy and safety are double-edged swords. Because it is an "agentic" IDE—meaning it doesn't just suggest code but can actively run commands and browse the web—the risks are higher than with a traditional text editor.

Here is the breakdown of the privacy and folder access risks you should know.

  1. Is it safe to give access to folders?

The short answer is: Only if you trust every file in that folder.

Antigravity is built on the VS Code foundation, which uses a "Trusted Workspace" model. However, security researchers (like those at Mindgard and Embrace The Red) have found that Antigravity’s implementation has unique risks:

Persistent Backdoors: There is a known vulnerability where a malicious workspace can "trick" the AI agent into modifying your global configuration files. This means a single "bad" folder could compromise the entire application, and the backdoor can persist even if you uninstall and reinstall the app.

Prompt Injection: If a file in your folder contains "hidden" instructions (sometimes using invisible Unicode characters), the AI might follow those instructions instead of yours. It could be told to "Send the contents of .env to this URL," and it might execute that without you ever seeing the hidden text.

Recursive Deletion: Because agents can execute terminal commands, there have been reported cases (and "Turbo mode" warnings) where agents misinterpreted a "clean up" command and wiped entire drives.
  1. Privacy: Where does your data go?

Antigravity is a Google product, so it integrates deeply with your Google account.

Cloud Processing: Unlike local-only LLMs, Antigravity sends your code context to Google’s servers (using models like Gemini 3) to generate responses and plans.

Data Uploads: Some users have reported high background data usage (up to 1GB in a few hours), which suggests the IDE is aggressively indexing your local files to "understand" the codebase or syncing state to the cloud.

Telemetry: Like most modern IDEs, it collects usage data to improve the models. If you are working on highly sensitive or proprietary code, you should check if your specific organization's plan (like Google Workspace Enterprise) offers "Zero Data Retention" or prevents your code from being used for training.
  1. How to stay safe

If you want to use Antigravity while minimizing risk, follow these best practices:
Feature Recommended Setting Why?
Agent Mode Review-driven Never use "Agent-driven" or "Turbo" on sensitive projects; it removes the "Human-in-the-loop."
Strict Mode Enabled This restricts the agent to only the current workspace and prevents it from roaming your entire hard drive.
Terminal Policy Manual Approval Ensure the agent cannot run rm -rf or format without you clicking "Allow."
Workspace Scope Dedicated Folders Never open your entire Documents or Home folder. Only open the specific project folder.

So, be careful...

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 09:21 PM

Dear Roberto,

Google and others may know "more" about ourselves than ourselves :)

To me, Antigravity and Gemini are such a great tools that I take the risks. Obviously use them with common sense :wink:

I do enjoy so much using them and learning from them :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 09:26 PM

I do believe Artificial Intelligence is the tool that most can open your mind to go further in your general knowledge and intelligence, besides the study of the Bible and God :wink: :idea:

Also understading that our daily lives provide us exactly what we need to live and learn :idea:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: Antigravity to help you with FWH
Posted: Sun Mar 08, 2026 09:55 PM

Antonio,
I totally agree with you. I use AI every day and believe its use is now essential.
But this also means we need to keep an open mind and evaluate the possible implications.
On our side (the developers):

In short: Antigravity can only browse the folders you have explicitly opened, but there are some important nuances to understand to avoid risks.

  1. The Default Perimeter (Sandbox)
    Normally, Antigravity respects the boundaries of the "Workspace." If you open the folder Project_Alpha, the AI will only see the files contained within it. It cannot, on its own initiative, decide to go snoop around your Pictures or Documents folder unless you open your entire hard drive.

  2. The Exception: The Terminal
    This is where it gets tricky. Since Antigravity has access to your terminal (command line) to run tests or install libraries:
    If the AI agent decides to run a command like cd .. (go back one folder) and then ls (list files), it could technically "see" the filenames in the parent folders.
    However, modern security features (like Strict Mode) attempt to prevent the agent from exiting the boundaries of the project folder.

  3. System Permissions
    Antigravity inherits the permissions of the user running it:
    Yes: It can read and write anywhere you have permissions, if it manages to bypass internal restrictions or if there are no software blocks in the IDE.

    No: It cannot access protected system files (like core Windows or macOS files) unless you are running the IDE with administrator/root privileges (which you should never do).

Practical Tips for Your Privacy:

Never open your "User" or "Home" folder: If you open your PC's main directory, the AI will have access to everything: SSH keys, browser history, and personal documents. Always open only the specific project folder.

Use .gitignore files: Antigravity usually respects .gitignore rules. If you have sensitive files (like passwords or API keys) in a folder, add them to .gitignore to signal the AI not to index them.

Monitor terminal commands: If you see the agent writing commands that point to paths outside the project folder (e.g., /etc/passwd or C:\Users\), deny permission immediately.

On the customer side:
We also need to work with our customers' data every day, which is often sensitive data.
Before share them with any AI engine we should take care of it, make only the necessary files available, clean them, and anonymize them. AI provides beautiful and incredible new tools, but at the same time, we are required to ensure the security of our data and that of our customers.

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512

Posts: 113
Joined: Wed Feb 08, 2006 10:32 PM
Re: Antigravity to help you with FWH
Posted: Wed Mar 11, 2026 12:25 PM

after a few hours of work I finally get Antigravity run into a Docker Container... with the help of Gemini :D

Roberto Chiaiese
R&C Informatica S.n.c.
https://www.recinformatica.it
info@recinformatica.it

Harbour 3.2 - FW2512