From 59e8694d7d91f214b7d6d11bc7a1d112407e8f43 Mon Sep 17 00:00:00 2001 From: ai Date: Mon, 1 Jun 2026 08:35:53 +0000 Subject: [PATCH] docs: mark salvage complete and queue AFP 0x13 --- AI.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- TODO.md | 43 ++++++++++--------------------------------- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/AI.md b/AI.md index 710042c..dd45d18 100644 --- a/AI.md +++ b/AI.md @@ -69,8 +69,14 @@ use, the current project status that the user pasted into the chat. `0x11`. - `NCP 0x2222 / 87 / 18` is decimal 87/18, function `0x57`, subfunction `0x12`. +- Legacy salvage endpoints are old function `22` decimal / `0x16`: + `22/27` scan, `22/28` recover, and `22/29` purge. They should remain thin + adapters over the same shared salvage backend, not a second implementation. - Keep `0x57` subfunction dispatch in `handle_func_0x57()` / namespace code, not as a second subfunction switch in `nwconn.c`. +- Old `0x16` calls need a minimal bridge in namespace code because short + directory handles must be resolved through existing `build_base()` / + `dir_base[]` internals before reaching the shared backend. - Versioned backend payload names follow Samba `vfs_recycle` literally: `Copy #1 of NAME`, `Copy #2 of NAME`, ... . Do not localize this string and do not run it through gettext; the NCP scan reply still reports the original @@ -85,8 +91,25 @@ use, the current project status that the user pasted into the chat. `WARN SALVAGE 87/16 STALE ...` for this cleanup. - Scan, recover, and purge should share the same scan/sequence/basehandle view so that a sequence returned by scan identifies the exact sidecar used later. +- The combined salvage smoke suite now covers NCP write/read payloads, 87/18 + purge pre-clean, hidden backend repository behavior, stale sidecar cleanup + with a manual payload-removal pause, three version captures, and recovering + the oldest version via sequence 0. - Append salvage endpoint tests to `tests/salvage/salvage_smoke_suite.sh` rather - than creating unrelated top-level scripts. + than creating unrelated top-level scripts, unless a helper binary is needed + and then started by the suite. + +## AFP 0x13 next task notes + +- After the NCP salvage endpoint work is complete, the next intended task is + AFP `0x13 Get Macintosh Info On Deleted Files`. +- Implement AFP `0x13` as an adapter over the shared mars_nwe salvage/deleted + entry record. Do not scan `.recycle` or `.salvage` directly from AFP code. +- Reuse existing AFP/nwatalk metadata mechanisms for FinderInfo, AFP + attributes, entry ids, resource fork state, and related restore/lookup + behavior. Do not add a parallel AFP metadata database. +- Check `tests/afp/` first for the endpoint inventory, WebSDK notes, and current + smoke coverage before writing code. ## Logging rules @@ -139,12 +162,32 @@ bash -n tests/salvage/salvage_smoke_suite.sh cc -DLINUX -fsyntax-only -Iinclude -Isrc -Ithird_party/yyjson/src src/nwsalvage.c src/namspace.c ``` +When server-side code or smoke helper clients change, rebuild both the server +and the helper targets so the runtime test is not using stale binaries: + +```sh +cmake --build build --target nwserv ncpserv +cmake --build build --target \ + ncp_delete_smoke \ + ncp_read_smoke \ + ncp_salvage_scan_smoke \ + ncp_salvage_recover_smoke \ + ncp_salvage_purge_smoke +``` + Runtime smoke suite: ```sh -tests/salvage/salvage_smoke_suite.sh +tests/salvage/salvage_smoke_suite.sh --out /tmp/mars-salvage-report.txt ``` -The suite may run pre-clean warning-only when `.recycle` or `.salvage` artifacts -are server/root-owned. Treat the final summary (`failures=0`, `ncp_warnings=0`) -as the important signal. +The suite streams the report to `--out` while running, so a failure before the +end should still leave useful output. It has a manual stale-payload pause: the +script prints a `sudo rm -f .../.recycle/...` command; remove that payload in a +second shell and press Enter. The next scan should remove the stale sidecar and +`grep` `/var/log/mars_nwe/nw.log` for `WARN SALVAGE 87/16 STALE`. + +Normal NCP reads of `.recycle` or `.salvage` are expected to fail with invalid +path. Verify payload data through the visible live file after NCP write or +recover, using `ncp_read_smoke`. Treat the final summary (`failures=0`, +`ncp_warnings=0`) as the important signal. diff --git a/TODO.md b/TODO.md index e63e64d..aa201b0 100644 --- a/TODO.md +++ b/TODO.md @@ -234,32 +234,6 @@ Follow-up: the WebSDK TTS calls include begin/end/abort transaction, status, threshold, and control/statistics operations. -### Salvage / deleted-entry backend - -Current status: - -- The shared salvage backend lives in `src/nwsalvage.c` / - `include/nwsalvage.h` and is hooked into the normal server delete path. -- Deleted payloads are moved to `.recycle` and per-object JSON sidecars are - written below `.salvage`. -- The sidecar schema preserves NetWare archive/fileinfo xattrs, AFP metadata - when present, inherited rights mask, and explicit trustee entries. -- The runtime configuration uses low `nw.ini` sections `51-59`. Section `53` - maps Samba-style behaviour flags (`k`, `v`, `t`, `m`), and sections - `55-58` cover size filters, exclude, exclude_dir, and noversions lists. -- NCP delete, Samba-compatible history naming, `87/16` scan, `87/17` recover, - and `87/18` purge are covered by the combined smoke suite in `tests/salvage/`. -- The legacy old salvage calls `22/27`, `22/28`, and `22/29` are adapters over - the same shared backend, not a second deleted-entry implementation. -- Samba-compatible history naming is the literal English `Copy #n of NAME` - format used by `vfs_recycle`; it is not localized. -- `NCP 0x2222 / 87 / 16` has a backend-backed scanner that reads `.salvage` - JSON entries and returns one salvageable entry per call. Stale JSON sidecars - whose `.recycle` payload has disappeared are not returned and are removed by - the scan path. This cleanup is logged as `WARN SALVAGE 87/16 STALE ...` and - covered by the salvage smoke suite with a manual payload-removal pause plus - a grep of `/var/log/mars_nwe/nw.log`. - ### AFP / Mac namespace backend Current status: @@ -268,15 +242,18 @@ Current status: tests under `tests/afp/`. Endpoint inventory, WebSDK audit notes, and AFP implementation history live in that directory instead of this project-level TODO file. -- AFP `0x13 Get Macintosh Info On Deleted Files` remains unsupported until the - NCP salvage scan/recover/purge endpoints expose the shared deleted-entry - backend semantics. +- The shared NCP salvage backend is now available and tested, including + versioned scan/recover/purge and stale-sidecar cleanup. It should be the + backing data source for AFP deleted-file compatibility work. -Follow-up: +Next task: -- After the NetWare salvage endpoints exist, implement AFP `0x13` as an adapter - over the mars_nwe salvage/deleted-entry record. -- AFP must not scan `.recycle` or `.salvage` directly. +- Implement AFP `0x13 Get Macintosh Info On Deleted Files` as an adapter over + the mars_nwe salvage/deleted-entry record. +- AFP `0x13` must not scan `.recycle` or `.salvage` directly; those remain + hidden backend repositories. +- Keep AFP metadata restore/lookup paths tied to the existing mars_nwe AFP and + nwatalk mechanisms, not a new side database. - Keep the detailed AFP TODO, inventory, and audit notes in `tests/afp/`. ## Deferred / optional protocol work