Skip to content

vms-01b: HELP .HLB compilation + HLP$LIBRARY search list - #481

Merged
baron-3dl merged 1 commit into
mainfrom
vms-01b-hlb-library
Aug 13, 2026
Merged

baron-3dl merged 1 commit into
mainfrom
vms-01b-hlb-library

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

Summary

Next deferred slice of the HELP facility epic (vms-01b), following #449's hierarchical .HLP engine: .HLB help-library compilation and HLP$LIBRARY search-list location. The epic stays open — per-command CDU help, HELP/MESSAGE, and the terminal subtopic-prompt-for-specified-topic remain.

What landed

.HLB compilationLIBRARY/HELP/CREATE lib.HLB src.HLP compiles a numbered-level .HLP source into a key-indexed .HLB. A VMS HELP library is keyed by its level-1 topics, so the compile splits the source by level-1 keys and writes one module per key into the OVMX "LBRO" container (dcl/hlb.h), reusing the vms-ca9 LIBRARIAN library infrastructure. LIBRARY/HELP list/extract keep working on the compiled form.

.HLB readerdcl_help.c help_open_hlb() reads the modules in index order and reconstructs the exact numbered-level tree, so a compiled .HLB is indistinguishable from its .HLP source once loaded. help_open_any() auto-detects LBRO magic vs raw source.

HLP$LIBRARY search list — HELP resolves its library through the documented HLP$LIBRARY, HLP$LIBRARY_1..n search list (help_open_libraries()), each translation defaulting to .HLB, falling back to SYS$HELP:HELPLIB.HLB then .HLP. Libraries merge in search order, so a topic in an earlier library wins.

.HLB representation choice

The .HLB is the existing OVMX "LBRO" container (shared with LIBRARY/LIBRARIAN via the new dcl/hlb.h), library type HELP, one module per level-1 key. This reuses vms-ca9's infra rather than defining a second format.

Clean-room (Rule 8)

The LIBRARY command surface, the HELP library-compile semantics (each level-1 key is a module), and the HLP$LIBRARY search list are documented behavior — VSI OpenVMS DCL Dictionary (LIBRARY, HELP) and the VSI OpenVMS Command Definition, Librarian, and Message Utilities Manual (Librarian). The unpublished .HLB byte layout is NOT reproduced; the LBRO container is a labeled OVMX design choice, never presented as VMS-authentic.

No facades (INV-DCL)

Real compile writing a real indexed file, real search-list resolution, real content lookup — no hardcoded help. VMS status codes throughout.

Tests

  • tests/dcl/test_help_engine.c — hermetic .HLB-reader + search-list-merge coverage (builds an LBRO container by hand, asserts navigation; two-library merge asserts first-library precedence). 29/29 ok.
  • tests/dcl/test_help_hlb.sh (new) — drives the full DCL chain: compile two .HLB libraries, wire HLP$LIBRARY + HLP$LIBRARY_1, assert HELP reads a topic present only in the first via HLP$LIBRARY, one only in the second via HLP$LIBRARY_1 (search continues), and first-library precedence for a shared key.
  • dcl-integration 136 passed / 0 failed; dcl-help-engine pass; dcl-harness-selftest pass. No vms-01b: HELP — faithful hierarchical-library reader (retire the printf shim + orphaned dead reader) #449 regression (existing HELP-content and LIBRARY tests green).

Native-link

No new translation unit or cross-image symbol (only a new header included by existing TUs + functions inside dcl_help.c/dcl_library.c/dcl_cmd_misc.c). Native-link enumerations unchanged — run_dcl_native.sh NOBJ stays 25 — and the three touched TUs compile clean under freestanding musl (-ffreestanding -fno-builtin).

Follow-up (not in scope)

The shipped SYS$HELP:HELPLIB.HLP is left as .HLP source (the reader consumes it, and the .HLB fallback is tried first); precompiling a HELPLIB.HLB into the bootable image is a mechanical follow-up.

🤖 Generated with Claude Code

Next deferred slice of the HELP facility epic (after #449's hierarchical
.HLP engine): compile a numbered-level .HLP source into a key-indexed
.HLB help library, and locate HELP's library through the HLP$LIBRARY
search list.

LIBRARY/HELP/CREATE lib.HLB src.HLP now compiles the source: a VMS HELP
library is keyed by its level-1 topics, so the compile splits the .HLP
by level-1 keys and writes one module per key into the OVMX "LBRO"
container (dcl/hlb.h), reusing the vms-ca9 LIBRARIAN library
infrastructure. The reader (dcl_help.c help_open_hlb) reads the modules
in index order and reconstructs the exact numbered-level tree, so a
compiled .HLB is indistinguishable from its .HLP source once loaded.
LIBRARY/HELP list/extract keep working on the compiled form.

HELP resolves its library through the documented HLP$LIBRARY,
HLP$LIBRARY_1..n search list (help_open_libraries), each translation
defaulting to .HLB, falling back to SYS$HELP:HELPLIB.HLB then .HLP.
Libraries merge in order so a key in an earlier library wins.

Clean-room (Rule 8): the LIBRARY command, the HELP library-compile
semantics (each level-1 key is a module), and the HLP$LIBRARY search
list are documented (VSI OpenVMS DCL Dictionary: LIBRARY, HELP;
Command Definition, Librarian, and Message Utilities Manual). The
unpublished .HLB byte layout is NOT reproduced -- the LBRO container is
a labeled OVMX design choice.

No facades (INV-DCL): real compile writing a real indexed file, real
search-list resolution, real content lookup. VMS status codes throughout.

Tests: test_help_engine.c gains hermetic .HLB-reader + search-list-merge
coverage (29/29 ok); new tests/dcl/test_help_hlb.sh drives the full DCL
chain (compile two libraries, wire HLP$LIBRARY + HLP$LIBRARY_1, assert
HELP reads the compiled .HLB via each, and first-library precedence for
a shared key). dcl-integration 136/0, dcl-help-engine pass, no #449
regression. Native-link unchanged (no new TU/symbol; NOBJ stays 25; the
three touched TUs compile clean under freestanding musl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit 77ff4b0 into main Aug 13, 2026
66 checks passed
baron-3dl added a commit that referenced this pull request Aug 13, 2026
…tes real OVMX code) (#500)

Bump OVMX_PRODUCT_VERSION V0.4-3 → V0.4-4. ~12 PRs since V0.4-3. Headline:
OVMX's own toolchain now builds real OVMX code to a running image INSIDE OVMX.

  SELF-HOST IN-GUEST   MMK.EXE drives TCC→LIBRARIAN→LINK over its mailbox DCL vs
                       real /dev/vms: #476 compile-in-QEMU (first-ever TCC-in-guest),
                       #488 archive, #493 full compile→archive→LINK→ACTIVATE (linked
                       OVMXRT.EXE IMGACT-activates + runs, exit 216), byte-identical,
                       CI-gated from clean archive. (BUILD.COM retirement → vms-89d.)
  UX FIDELITY          #461 DIRECTORY wildcards/ellipsis · #478 COPY/DELETE/RENAME
                       (explicit-version DELETE) · #481 HELP .HLB library · #487 SET
                       SYMBOL scope · #491 DCL ON/SET NOON error control
  BOOT INTEGRITY       #499 boot-smoke green (aligned 3 e2e tests to authentic
                       DELETE/DIRECTORY output; strengthened the fail-stop guard)
  + swept other threads' merged work

Co-authored-by: alice <alice@workspace.local>
Co-authored-by: Claude Opus 4.8 (1M context) <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