Skip to content

vms-1c6 (slice): DIRECTORY trailer + version fidelity - #447

Merged
baron-3dl merged 1 commit into
mainfrom
vms-1c6-directory-fidelity
Aug 13, 2026
Merged

baron-3dl merged 1 commit into
mainfrom
vms-1c6-directory-fidelity

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

Slice of vms-1c6 — File/RMS user-visible fidelity

vms-1c6 is broad (DIRECTORY format, versions, wildcards/ellipsis, protection). This PR does one slice: DIRECTORY output-format + file-version fidelity. The item stays open for the remaining slices (listed below).

The bug

A bare $ DIRECTORY in real OpenVMS ends Total of N files. — with no block count. The block count appears only when file sizes are displayed:

  • /SIZETotal of N files, M blocks.
  • /FULLTotal of N files, U/A blocks. (used/allocated)

OVMX always printed , M blocks. even for a bare listing — a tell a VMS user spots on the first DIRECTORY.

Citation (clean-room, Rule 8)

VSI OpenVMS DCL Dictionary, DIRECTORY command examples (OpenVMS DCL Dictionary — www0.mi.infn.it/~calcolo/OpenVMS/ssb71/9996/9996p013.htm): default Total of 4 files.; /SIZE=USEDTotal of 4 files, 15 blocks.; /FULLTotal of 1 file, 390/390 blocks.
Corroborated by real-VAX oracle capture already in-repo: tests/ods2/PROVENANCE-real_vax_ods2.md line 998 — Total of 1 file, 1/1 block.

Changes

  • New dcl_print_dir_total() in src/vmsdcl/dcl_cmd_file.c emits the authentic trailer per qualifier; routed through the normal, /GRAND_TOTAL, and /TRAILING footers.
  • /FULL shows used/allocated blocks from real st_blocks (not fabricated); the /SIZE single count is real logical blocks. (INV-6: no fabricated numbers.)
  • Edited existing DIRECTORY code in place — no new cross-image symbol / DCL TU, so no native-link enumeration wiring needed.

Versions (real, not fabricated)

Versions were already real: files are stored on disk as name.type;N (the convention sys$create() uses), and cmd_directory() reads the stored ;N back and sorts highest-version-first. The new test locks the ordering down (creates ;1,;2,;3; asserts ;3 is listed before ;1). The ;1 fallback applies only to genuinely unversioned foreign files, never as a blanket ;1 on real versioned files.

Tests

  • New tests/dcl/test_directory_format.sh: header, three real ;N versions highest-first, bare trailer has no blocks, /SIZE trailer has blocks.
  • test_directory_version.sh: corrected trailer assertions from the OVMX-bug form (N files, 0 blocks.) to VMS-authentic (N files.) — a correction to the source of truth, not a weakening (cited inline).
  • QEMU e2e existence checks (parts_demo, release_acceptance, product_install, mount, sysgen_versioning) relaxed to a format-tolerant Total of [1-9]... files?[.,]; scsnode negative check updated to the no-blocks empty trailer. (test_install_boot_e2e.sh / release_install_inner.sh already used the tolerant form.)

ctest -R dcl-integration: 124 passed, 3 failed. The 3 failures (test_install_command, test_lexical_scsnode, test_misc_commands) are pre-existing and environmental — they need the installed INSTALL.EXE image / a configured SCSNODE executive not present in a bare dev-worktree build (the documented Debug-ctest vs full-harness gap). None touches DIRECTORY.

Remaining vms-1c6 slices (follow-ups)

  • Wildcards / ellipsis: multi-directory grand-total rollup (Grand total of D directories, ...); this PR keeps the single-directory grand total.
  • Zero-match error fidelity: real VMS emits %DIRECT-W-NOFILES, no files found for a zero-match exact spec; OVMX prints the empty Total of 0 files. trailer.
  • /FULL body: real VMS /FULL is a multi-line per-file record (file ID, Created/Revised/Expires/Backup, RMS attributes); OVMX's /FULL body is still a simplified one-liner. This PR fixes only its trailer.
  • Protection and DCL file commands bypassing RMS (COPY/DELETE/RENAME via raw fopen/unlink) — separate slices per the item.

🤖 Generated with Claude Code

The surface a VMS user reads every minute. A bare DIRECTORY in real
OpenVMS ends "Total of N files." with NO block count; the block count
appears only when file sizes are displayed: /SIZE -> "Total of N files,
M blocks.", /FULL -> "... U/A blocks." (used/allocated). OVMX always
printed ", M blocks." even for a bare listing — a tell a VMS user spots
on the first DIRECTORY.

Grounded (clean-room, Rule 8): VSI OpenVMS DCL Dictionary, DIRECTORY
command examples. Corroborated by real-VAX oracle capture
(tests/ods2/PROVENANCE-real_vax_ods2.md: "Total of 1 file, 1/1 block.").

- New dcl_print_dir_total() emits the authentic trailer per qualifier;
  routed through the normal, /GRAND_TOTAL, and /TRAILING footers.
- /FULL now shows used/allocated blocks from real st_blocks (not
  fabricated); default single count is real logical blocks.
- Versions were already real (on-disk name.type;N read back, highest
  first) — locked down by a new ordering assertion.

Tests:
- tests/dcl/test_directory_format.sh (new): header, three real ;N
  versions listed highest-first, bare trailer has no blocks, /SIZE
  trailer has blocks.
- test_directory_version.sh: corrected the trailer assertions from the
  OVMX-bug form ("N files, 0 blocks.") to VMS-authentic ("N files.").
- QEMU e2e existence checks (parts_demo, release_acceptance,
  product_install, mount, sysgen_versioning) relaxed to a format-tolerant
  "Total of [1-9]... files?[.,]"; scsnode negative check updated to the
  no-blocks empty trailer.

ctest dcl-integration: 124 passed, 3 failed (pre-existing, environmental:
missing INSTALL.EXE image / unconfigured SCSNODE executive — untouched by
this change).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit 169ff98 into main Aug 13, 2026
61 checks passed
baron-3dl added a commit that referenced this pull request Aug 13, 2026
…456)

Bump OVMX_PRODUCT_VERSION V0.4-1 → V0.4-2. 10 PRs since V0.4-1, toward the
0.5 milestone:

  owns-kernel    #450 OVMX builds its own pinned linux-6.12.103 LTS from source
                 (byte-reproducible, boots 17/17+24/24) — vms-19e beachhead
  self-host #4   #446 MMK.EXE parses descrip.mms + emits TCC→LINK plan
                 (exec-drive facilities, all proven vs real /dev/vms:)
                 #451 lib$spawn real DCL (facade killed) · #452 mailbox IPC
                 #453 write-attention AST · #454 exec-drive design record
  UX fidelity    #447 DIRECTORY format+versions · #448 Ctrl-T status line
                 #449 hierarchical HELP engine · #455 SHOW MEMORY (drop
                 buffers+cached fabrication)
  + swept other threads' merged work

MMK does not yet DRIVE builds (spine #4 needs async AST delivery + IO$M_NOW
+ DCL-mailbox-SYS$INPUT — filed vms-feb/5df/786, faithful path in flight).

Co-authored-by: alice <alice@workspace.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
baron-3dl added a commit that referenced this pull request Aug 13, 2026
…otal, %DIRECT-W-NOFILES (#461)

* vms-1c6: DIRECTORY wildcards + ellipsis uniformity, multi-dir grand total, %DIRECT-W-NOFILES

Next slice of vms-1c6 (File/RMS user-visible fidelity), after the DIRECTORY
format+version slice (#447). Scope: the wildcard/ellipsis surface a VMS user
drives constantly.

- `*` (any chars) and `%` (single char) filename wildcards continue to route
  through the single matcher vmsfs_wildcard_match(); the DIRECTORY collect path
  is refactored into dir_collect()/dir_print_entries() so the single- and
  multi-directory paths share one filename matcher and one renderer (no divergent
  matchers — the DCL file commands already all call vmsfs_wildcard_match).

- `[...]` / `[dir...]` ellipsis now actually recurses the real on-disk vmsfs
  tree (dir_gather_recurse — a genuine depth-first opendir/readdir walk, INV-6:
  no faked recursion). dir_deellipsize() rewrites the ellipsis spec to the start
  directory, reusing the existing resolution.

- Multi-directory listing prints a per-directory header + "Total of N files"
  subtotal for each directory that has matches, then one
  "Grand total of D directories, F files[, M blocks]." rollup.

- Zero matches now yield the authentic "%DIRECT-W-NOFILES, no files found"
  warning with NO header, instead of an empty "Total of 0 files." success.

Grounded (clean-room, Rule 8): VSI OpenVMS DCL Dictionary, DIRECTORY — the "..."
ellipsis directory wildcard ("this directory and all subdirectories below it"),
the per-directory + Grand total multi-directory layout, and the NOFILES warning.

Tests: new tests/dcl/test_directory_wildcards.sh exercises *, %, ellipsis
recursion (per-dir subtotals + two-directory grand total), and the NOFILES
warning against a real subdirectory tree. test_directory.sh made hermetic
(lists a real temp dir) so the smoke test no longer relies on the pre-existing
non-authentic header-before-DNF behavior. dcl-integration: 125 passed
(remaining 3 failures — install/scsnode/misc — are pre-existing, environmental,
identical on baseline: they need INSTALL.EXE/executive/PCSI). vmsfs_unit green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* vms-1c6: fix test_create_dir for authentic empty-directory DIRECTORY output

CI Build & Test caught the real regression: test_create_dir listed the freshly
created (empty) directory with `DIRECTORY [.NEWDIR]` and asserted the output
contained "NEWDIR". That only worked because the OLD code printed a
"Directory ...] / Total of 0 files." header for an empty directory. This PR
makes an empty listing yield the authentic "%DIRECT-W-NOFILES, no files found"
(no header), so "NEWDIR" no longer appears — the test encoded the old,
non-authentic output.

Fix (not a weakening — a stronger, VMS-authentic proof): create the directory
with an absolute target spec so it lands deterministically under the parent,
then list the PARENT and assert the "NEWDIR.DIR;1" entry with "Total of 1 file."
(a directory is a .DIR file within its parent — VSI OpenVMS DCL Dictionary,
DIRECTORY). This proves creation via a real, non-empty listing and also guards
EXPECT_NOT %DIRECT-W-NOFILES and EXPECT_NOT mkdir:. Self-cleaning (no device-root
leak the previous form left behind).

Full dcl-integration now 128 passed / 0 failed with /vms set up exactly as the
CI Build & Test job does (sudo mkdir /vms/SYS0/SYSCOMMON/... ; ctest).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

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