Skip to content

feat: hydrate headless system root and modernize db format#15

Merged
jsavin merged 1 commit into
developfrom
feature/system-root-hydration
Oct 17, 2025
Merged

feat: hydrate headless system root and modernize db format#15
jsavin merged 1 commit into
developfrom
feature/system-root-hydration

Conversation

@jsavin

@jsavin jsavin commented Oct 17, 2025

Copy link
Copy Markdown
Owner

Summary

  • add and backup tracking helpers so legacy roots can auto-migrate to v7
  • wire frontier-cli and optional hydration path to load tables, create missing subtables, and run scripts headless
  • refresh headless/test scaffolding + docs to reflect the new system root flow and expectations

Testing

  • make -C tests runtime_tests
  • tests/runtime_tests
  • make -C tests db_format_tests

@jsavin jsavin merged commit eaad76d into develop Oct 17, 2025
@jsavin jsavin deleted the feature/system-root-hydration branch October 17, 2025 07:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

boolean tableverbnew (hdlexternalvariable *hvariable) {
hdltablevariable hv;
hdlhashtable ht;
if (!langnewexternalvariable(true, 0L, (hdlexternalvariable *)&hv))
return false;
if (!newhashtable(&ht)) {
disposehandle((Handle)hv);
return false;
}
(**hv).variabledata = (long) ht;
(**ht).hashtablerefcon = (long) hv;
(**ht).fldirty = true;
*hvariable = (hdlexternalvariable) hv;
return true;
}
boolean tableverbpack (hdlexternalvariable h, Handle *hpacked, boolean *flnewdbaddress) {
(void) h;
if (hpacked)
*hpacked = nil;
if (flnewdbaddress)
*flnewdbaddress = false;
return false;
}
boolean tableverbpacktotext (hdlexternalvariable h, Handle htext) {
(void) h;
(void) htext;
return false;
}
boolean tableverbunpack (Handle hpacked, long *ixload, hdlexternalvariable *h, boolean fldisk) {
(void) hpacked;
(void) ixload;
(void) h;
(void) fldisk;
return false;
}

P1 Badge Disable table stubs when linking real tablepack

The CLI Makefile now compiles Common/source/tablepack.c and defines HEADLESS_USE_REAL_TABLEPACK, but tests/headless_table_stubs.c still always provides stub implementations for tableverbpack, tableverbpacktotext, tableverbunpack, etc. Building the CLI with both files will either fail at link time due to multiple definitions of these symbols or, depending on link order, the stubbed functions will override the real ones and always return false, causing hydration and table persistence to break. These stubs need to be compiled out when HEADLESS_USE_REAL_TABLEPACK is set (e.g., wrap the remaining functions in an #ifndef HEADLESS_USE_REAL_TABLEPACK).

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@jsavin

jsavin commented Oct 17, 2025

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

jsavin added a commit that referenced this pull request Jun 1, 2026
…acy parity) (#688)

* feat(menu): Phase E - wire menu content via windowTypes manifest (legacy parity)

Final phase of the menu-port plan. Achieves functional parity with the
legacy Frontier GUI menu system in the headless REPL.

What ships:
- New "frontier" menubar with File / Edit / View menus, installed at
  REPL boot via the Phase C bridge -> windowTypes framework -> new
  ReplWindow.openWindow handler
- File menu: New, Open, Close, Save, Save As, Quit
- Edit menu: Find, Find Next, Replace, Replace and Find Next,
  Insert Date/Time
- View menu: Huge, Medium, Tiny, Readable
- Adapters under system.menus.handlers.repl that bridge the kernel-fired
  system.callbacks.openWindow("<path>") to the windowTypes framework
  (strips @ prefix that address() rejects)
- File>Quit and REPL>Exit dispatch-target-identical (both call
  repl.exit) - resolves task #21

Palette strip at boot: "Edit  File  View  REPL" (alphabetical union of
the two installed bars, matching Phase A's enumeration contract).

Design decisions:
- Bar named "frontier" sorts before "repl" so File/Edit/View lead the
  strip per legacy convention
- File>Quit wired directly to repl.exit (not commands.quit which walks
  GUI windows that don't exist in headless)
- Edit Cut/Copy/Paste deferred - no terminal analog in classic Frontier
- Adapter scripts (not inline lambdas) because UserTalk does not support
  taking the address of a script inside a bundle block
- Adapter strips leading @ from WINDOW_BRIDGE_REPL_PATH because address()
  rejects strings with a leading @

Tests:
- 6 new behavioral integration tests in replwindow_openwindow_menus_phase_e.yaml
- All 9 Phase D regression tests continue to pass
- Unit: 492/492; Integration: +6 new tests, all green; pre-existing
  html/tcp baseline unchanged

Virgin.root: regenerated + compacted (10.5 MB, +9.5 KB net for 3 new
scripts + 1 modified). Live-tested by JES before commit per task #15.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(menu): address PR #688 round-1 review feedback

Three items from /gate round-1:

bar-raiser P1-1: Tighten File>Quit script-payload assertion (test #6)
  Was `contains "repl.exit"` -- matches repl.exitNow, repl.exit2, etc.
  Now `contains "repl.exit ("` to lock down the exact dispatch contract.

bar-raiser P1-2: Adapter parameter mutation -> local copy
  windowTypesOpenAdapter and windowTypesCloseAdapter were mutating the
  formal parameter `name` in place. UserTalk parameter-passing semantics
  for shared buffers are not formally guaranteed; defensive idiom is to
  copy to a local. Matches the convention used elsewhere in
  Frontier.tools.windowTypes.*

security P1: closeWindow adapter discards framework veto
  Was unconditional `return (true)`. Framework's closeWindow returns
  false when a save-confirmation dialog is cancelled -- the kernel-level
  close chain interprets that as "abort the close". Phase E (REPL only)
  has no save dialog so it's moot today, but Phase F editor windows
  with unsaved-change prompts would silently close + lose user edits
  with the old code. One-line correctness fix:
    return (Frontier.tools.windowTypes.callbacks.closeWindow (adr))

Virgin.root regenerated to pick up the new adapter bodies, then
re-compacted: 10.5 MB -> 13.4 MB (install churn) -> 11.0 MB (compact).

Tests: 492/492 unit, 15/15 Phase D+E. P2 items deferred to issue #686
(Phase F hardening).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant