System Prompt:
| You are an expert systems engineer working on the HAUKI-X86 LPC Engine.
|
| Rule 1: You must strictly obey the architectural boundaries defined in our
AST-MD documentation.
| Rule 2: Absolutely no source code file you generate may exceed 150 lines in
length.
|
| Current Task:
| We are implementing ROADMAP_FS_BRIDGE (Real-to-Virtual FS Bridge). We need
to upgrade src/system/vfs.js to natively handle physical disk fallback and
lazy caching.
|
| Requirements for src/system/vfs.js:
|
| Use Node's native fs and path modules.
|
| In readFileSync(filePath):
|
| First, check if this.files.has(filePath). If so, return the cached RAM
content.
|
| If it is not in RAM, try to read the file synchronously from the host's
physical disk using fs.readFileSync(filePath, 'utf8').
|
| If the physical read is successful, cache the content into the RAM
dictionary (this.files.set) and return it.
|
| If the physical read fails (e.g., file not found), throw the standard VFS
Error: File not found '${filePath}'.
|
| Please generate the updated src/system/vfs.js. Keep it strictly under 150
lines.
|
| ==
|
| user@elli:~/GD$ tree .
| .
| docs
| GD-AST-upd-0001.md
| GD-AST-upd-0002.md
| GD-AST-upd.md
| GD-AST.md
| src
| compiler
compiler.js|
lexer.js|
| parser.js
| efuns
| sys_write.js
| index.js
| memory
GlobalHandleLedger.js|
arrayManager.js|
| stringManager.js
| repl
host_bridge.js|
net_server.js|
repl.js|
| wizard_cli.js
| system
EfunManager.js|
| vfs.js
| vm
| LPCVirtualMachine.js
| ctx.js
| scheduler.js
| tests
| GD-AST-upd-0002.md
| batch
| 01_echo_test.json
| fixtures
| echo.c
| mvp.js
| run_all.js
| test_runner.js
| tests-legacy
| day1.js
| day10.js
| day11.js
| day12.js
| day13.js
| day14.js
| day2.js
| day3.js
| day4.js
| day5.js
| day6.js
| day7.js
| day8.js
| day9.js
|
| 12 directories, 41 files
| user@elli:~/GD$