35 KiB
AI working notes for mars-nwe
This file is the handoff and assistant-rule document. It should keep the next chat on the current track without forcing it to reconstruct old patch history. Keep it short enough to read before touching code.
Start of a new chat
- Treat
mars-nwe-masteras the root/superproject. The othermars-*bundles are submodules or sibling component sources needed by the root build. - Read the root
*.mdfiles anddoc/*.mdbefore changing namespace, salvage, transport or dependency code. The most important active files areTODO.md,REDESIGN.md,ENDPOINTS.md, this file, and:doc/NSS_IMPORT_NOTES.mddoc/NWFS_SALVAGE_COMPRESSION_TOOLS.mddoc/HANDOFF_AUDIT.mddoc/TOOLBOX_PLAN.md
- Do not assume an older bundle is current. Use the latest applied user state or the latest bundle/patch explicitly accepted by the user.
- For a fresh build in a new chat, check whether
prepare-local-deps.shis present in the root and run/use it before trying to build; it stages the uploaded offline third-party tarballs and local-only headers needed by the current dependency layout. - Default language with the user is German; repository documentation remains English unless the existing file is German.
Documentation ownership
TODO.mdis the active backlog. The top implementation dashboard is allowed and should stay. Unfinished long-running tracks stay inTODO.mduntil real implementation/test work closes them.REDESIGN.mdis the durable architecture/design record. Put stable plans, rationale and completed design decisions there, not patch chronology.AI.mdis for working rules, current handoff state, rejected patches and next action guidance. Keep it concise; do not append duplicate historic handoff dumps forever.ENDPOINTS.mdis the decimal/hex NCP audit table.doc/*.mdfiles are focused topic audits/roadmaps. Keep namespace, NSS public-core and salvage/compression/tool details in their matching doc files.
When a TODO is finished, remove it from TODO.md in the same patch and record
its stable outcome in REDESIGN.md or the focused doc/*.md file. Do not move
unfinished work out of TODO.md merely because its architecture is documented.
Current accepted patch line
Latest commit after this handoff refresh in an up-to-date tree:
docs: record NSS salvage repair import milestone
Compare git log -1 --format="%s" with this subject. If the tree is older,
check which documentation/import-boundary commits are missing and replay them
before starting new work.
Current patch handoff block
Last completed work block: NSS Salvage/ZLSS/Repair userspace runtime import
The code line through 0783 nwnss: use generic NSS runtime naming is accepted.
The recent runtime-helper patches added shared NSS page/uaccess helpers and then
removed Mars-specific names from the imported NSS path. Inside NSS source and
private NSS compat code, use generic NSS-facing names such as NSS_USERSPACE,
NSS_VIRTUAL_IO, NSS_BLOCK_IO, NSS_STORAGE_BACKEND_*, NSS_IO_BACKEND,
NSS_DEFAULT_CODEPAGE, NSS_UNITABLE_DIRS, NSS_UNICODE and NSS_MPK_*.
Do not add new MARS_NWE_NWNSS_* guards, nwnss* helper file names or
Nwnss* helper symbols in the NSS import itself.
The build/library container is still named nwnss: paths such as src/nwnss/
and include/nwnss/, the CMake target, the mars_nwe::nwnss alias and CTest
names like nwnss.unicode may keep that name because this project builds the
official NSS code as a MARS-NWE library. The imported code and helper layers
inside that container should look like NSS, not like Mars-specific forks.
The companion-file rule remains role-based, not a blanket *Userspace rule:
keep original NSS source files as original-like as possible, add only small
dispatch points, use *Userspace.c / *Userspace.h for libnwfs/Mars/OtherFS-
facing adapter boundaries, use *IoUring.c / *IoUring.h for concrete direct
I/O, use *Fuse.c / *Fuse.h for FUSE-facing provider callbacks, and use
*Runtime.c / *Runtime.h for NSS runtime/cache/workqueue semantics that
replace former kernel helpers inside the library. Shared helpers use Nss*
file/symbol names, for example NssPageRuntime and NssUaccessRuntime.
Ownership boundaries are current: nwserv is the process governor, nwconn is
the NCP server, libnwfs is the Mars/NCP file wrapper, libnwnss is the NSS
provider and future FUSE/io_uring/HostFS/OtherFS boundary owner, and future
NDS/eDirectory compatibility belongs in libnwnds over libnwdirectory /
nwdirectory.
Build/test expectation: the uploaded ncpfs-2.2.7.tar.gz is part of the local
dependency set and can be built when full build targets need libncp. Separate
build/link success and offline NSS unit tests from server-dependent integration
CTests; the latter require a running configured Mars server and should not be
reported as ordinary offline unit-test failures.
Salvage/ZLSS/Repair import milestone through 0812
The code line through 0812 imports the first large real-NSS Salvage/Purge/ZLSS
runtime slice into libnwnss without link stubs. It includes the original NSS
Salvage/Purge logs and trees, ZLSS transaction/log/pool/volume/file-map/free-
tree dependencies, VolumeDB/UserTree/DirTree/NameTree/SuperBlock/LogicalVolume
helpers, and the first Repair/Maintenance/RAV/ZIOP runtime dependencies. The
modern-compiler fixes in this block are intentionally limited to include fixes,
NSS_USERSPACE/runtime guards, page/uaccess/runtime routing, and old-style
voidfunc_t/statusfunc_t callback casts.
No new NSS dependency stubs were added for this block. When an undefined NSS
symbol appears, continue importing the real original source file or
public_core/sharedsrc/*.c.h provider before considering any local boundary.
Only genuine platform/runtime edges may get local code.
The imported ZLSS code is currently a userspace-runtime compile/link foundation,
not an enabled host storage backend. Real NSS disk/block I/O remains behind a
later explicit provider, expected to use an io_uring-style backend. FUSE
remains the future nwnssmount surface for mountable real NSS volumes.
OtherFS/HostFS must continue to work directly through the userspace provider
path with host xattrs and later sidecar metadata; do not require FUSE for
OtherFS.
Mario's first full test after 0812 reported 71 CTests total, 63 passed and the
8 expected server-dependent *.ncpfs.* tests skipped. Treat this as the
current offline green baseline for the import track.
Next import/use-case direction
With the Salvage/ZLSS/Repair runtime now buildable, start making the imported semantics usable from explicit userspace boundaries rather than adding more stubs or ad-hoc shortcuts. The next feature order is:
- user quota userspace boundary;
- disk quota / volume quota userspace boundary;
- directory quota userspace boundary;
- salvage userspace boundary.
For each area, keep original NSS source semantics in the imported files and put
Mars/NWFS/OtherFS/HostFS adaptation in role-specific *Userspace.c / *.h
companions. Use netware.metadata / netware.userquota.* NSS-shaped xattrs
for OtherFS where applicable. Keep real NSS-volume disk I/O inactive until the
future io_uring provider boundary exists.
Directory/NDS work order
- Do not combine LDAPv2/LDAPv3 compatibility work with the FLAIM storage-engine swap. Keep TinyLDAP/nwdirectory on its existing flatfile/mmap/journal backend and add behaviour tests first.
- LDAP CTests should start
nwdirectoryon127.0.0.1:<free-port>with a temporary flatfile workdir and test LDAPv2/LDAPv3 bind/search/unbind. - Add
libnwndsand console-onlynwsetuptogether after LDAPv2/schema flatfile behaviour is testable. Do not make the first setup path depend on the TUI. - Later, add FLAIM storage as CMake-selected parallel backend source files that export the same function names as the flatfile files. Do not break upstreamable flatfile TinyLDAP code.
Rejected or superseded patches that must not be reused as-is:
0380039804030677(ncpNdpUserspace.ccollector — rejected; search real NSS sources instead)0671(superseded by0673;virtualIOUserspace.cremoved, realsharedsrc/virtualIO.c.hused)
Current immediate direction
The COMN import/audit chain is complete and the current design boundary is the
libnwnss userspace backend split. The XAttr/LSA import is now active inside
libnwnss; this is not an nwfs migration yet:
-
extAttrBeast.his atinclude/nwnss/include/extAttrBeast.handlsa.his atinclude/nwnss/include/lsa.h. -
0786 imported the first real NSS XAttr/EA runtime block:
include/nwnss/public/zXattr.h,src/nwnss/lsa/lsaXattr.c,include/nwnss/lsa/lsaPrivate.handsrc/nwnss/comn/common/extAttrBeast.c. -
0788 imported the first real LSA dependency block:
src/nwnss/lsa/lsaComn.c,src/nwnss/lsa/lsaErr.c,src/nwnss/lsa/lsaUser.candinclude/nwnss/lsa/lsaStartup.h. -
0788 also added
src/nwnss/lsa/lsaSuperXattr.cas a narrow extraction of thelsaSuper.chelpers needed bylsaXattr.c(getMode,getUid,LSACtimeIsMetadataModTime) without importing the full kernel VFS/superblock module yet. Keep this aligned with the originallsaSuper.cbodies until the full VFS/FUSE/backend boundary is designed. -
0790 adds the first explicit XAttr userspace boundary:
include/nwnss/internal/lsaXattrUserspace.handsrc/nwnss/lsa/lsaXattrUserspace.c. This boundary owns only the kernel-shaped dentry/inode/super-block adapter needed to call the originalnetware_*xattrentry points fromlibnwnss. It uses the genericNssUserspaceProviderboundary for provider selection. That provider decision is deliberately not XAttr-specific: it is the shared future decision point for XAttr, trustees, quota, salvage, namespace helpers and real NSS I/O. OtherFS/HostFS must be usable directly through host xattrs or later sidecar metadata; FUSE is not the OtherFS data path. FUSE is reserved for a future mountable real-NSS-volume view, with disk I/O below it going through an explicit backend such asio_uring. -
Any remaining XAttr/LSA unresolved symbols should be resolved from the real
nss.tar.bz2/nss-common.tar.bz2NSS sources first. Do not add fake XAttr semantics or Mars-only storage policy to original NSS files. -
Use Novell/Micro Focus/NDK packages only as documentation/reference, not as code/header provenance.
-
Keep original NSS files original-like. Do not use
*Userspace.c/*.has a catch-all companion name. Use role-specific companion files instead:*Userspace.c/*.hfor libnwfs/Mars/OtherFS/HostFS adapter boundaries,*Fuse.c/*.hfor FUSE/nwnssmount-facing provider callbacks,*IoUring.c/*.hfor concrete Linux direct/block/file I/O, and*Runtime.c/*.hfor NSS runtime semantics such as cache state, dirty tracking, wait barriers, timers, work queues, HMC/page-cache substitutes and commit/flush coordination. Keep HostFS, OtherFS, FUSE, io_uring and runtime policy out of imported original files. Current imported runtime candidates are:hmc.c(page/slab/highmem/inode-pagecache shim),comnIO.c(kmap/copy-from-user helpers),zAPI.c(uaccess/address-limit helpers), andcomnCmdline.c(kernel-stylesi_meminfo). The current tree routes those through sharedNssPageRuntime/NssUaccessRuntimehelpers. Reuse these helpers for later imports instead of adding fresh local kernel shims. -
virtualIOis_ADMIN/management virtual-file and XML datastream I/O, not a disk/block backend. Do not route futureio_uringdesign throughvirtualIO. -
Do not touch or migrate the existing local
nwfsXAttr code in this phase;nwfswill consume the libnwnss semantics later after the libnwnss side is tested. -
Treat the XAttr/LSA import as the metadata storage/lookup foundation for later quota and salvage userspace boundaries, not as their semantic owner. Quota and salvage remain separate NSS semantic areas, but their valid OtherFS state should be found through NSS-shaped xattrs or NSS metadata.
libnwnssowns those provider operations;libnwfsonly translates Mars/NCP requests to them. -
Treat the imported XAttr/LSA block as the first user of the generic userspace provider boundary. For OtherFS, do not require FUSE: read/write NetWare/NSS metadata directly through host xattrs first, and later sidecar metadata where host xattrs are unavailable or insufficient. FUSE is reserved for a future mountable real-NSS-volume view; that path should use explicit real-NSS I/O backend files such as
*IoUring.cbelow the NSS core. -
For namespace, keep
libnwnssas the NSS provider and put Mars/NWFS compatibility wrappers innwfslater. Most namespace helpers are pure string/provider operations;*_generateUniqueName()needs the same generic userspace companion-file pattern because HostFS/OtherFS directory collision lookup may need NSS-shaped xattrs or NSS metadata and must not be added directly to the original NSS namespace files. -
Quota, salvage, namespace unique-name handling and future backend-sensitive NSS functions all follow the same ownership split.
libnwnssis the NSS provider for semantics imported fromnss/nss-common;nwfsis the later Mars wrapper/adapter. Existingnwfsquota and salvage code is only an implementation inventory and must not be treated as provenance or moved wholesale intolibnwnss. -
OtherFS/HostFS quota policy such as Linux
quotactl(), project-quota or metadata-only accounting belongs in parallel userspace boundary files such aslsaQuotaUserspace.cordirQuotasUserspace.c, not inline in original NSS files. -
Salvage follows the same rule:
.salvageJSON is legacy migration/debug state only and should not remain authoritative..recycleremains the OtherFS payload directory, while valid NetWare salvage metadata should come from NSS-shaped xattrs or later imported NSS salvage metadata through asalvageUserspace.cstyle boundary.
Before namespace code changes, keep the legacy logging audit in mind: old MARS
accepts numeric debug thresholds from 0 to 99, but the actual source mostly
uses 1..5. The future nwlog facade should give those normal levels clear
semantic names instead of preserving the old overloaded buckets: 1=error,
2=warn, 3=info, 4=debug and 5=trace. debug is local diagnostic detail; trace is packet/message/handoff path following across process or provider boundaries. New config should expose the cumulative numeric masks 0, 1, 12, 123, 1234 and 12345 as synonyms for off, error, warn, info, debug and trace, and use one global [logging] level plus optional [logging.process.<name>] level overrides; the old numeric 100..106 process entries stay accepted for compatibility. Useful legacy 6..99 traces should
map to nwlog_detail() later. nwlog_detail() is not part of the normal
1..5 threshold ladder: normal builds return 0, while MAINTAINER_BUILD
builds may emit detail whenever such a call site is reached. No INI option may
enable it in a normal build.
nwlog is the facade/backend plan. Do not add zlog calls or reintroduce a
zlog build dependency; zlog is Apache-2.0 and is not compatible with the
repository's GPL-2.0-only core policy. See include/nwlog.h and
doc/LOG_LEVEL_AUDIT.md.
Before namespace code changes, keep the terminal-tooling decision in mind when
touching FLAIM tests or admin tools: do not add new direct curses.h users.
Future interactive tools should go through the planned nwtui/nwi18n stack
and the multi-call nwtoolbox applet model documented in
doc/TOOLBOX_PLAN.md. Configuration parsing/editing is covered in the same
file: use the planned shared libnwcore nw_ini_* reader/writer so server
code and tools share one policy. Production daemons must not depend on the TUI
stack.
Before namespace code changes, use the handoff audit rules in doc/HANDOFF_AUDIT.md.
New namespace/NWFS work must not add new magic return(-1) / return(-2) paths.
Use the provider names in include/ncp_endpoint.h for audits and future endpoint
tables, but do not wire the enum into runtime dispatch until the current
nwconn to nwbind handoff sites are annotated.
Then continue the NSS namespace track inside libnwnss:
libnwnssis the single userspace library for imported NSS functions and semantics. Do not create a separate namespace/AdminVol NSS library. The library should grow from the existing imported runtime into the real NSS components needed by Mars NWE: namespace, trustee/effective-rights helpers, XATTR/EA/metadata helpers and later AdminVol semantics.- Work bottom-up from the original NSS Linux sources. Use the files in
nss.tar.bz2andnss-common.tar.bz2; inspect NSS Makefiles/Kbuild-style source lists as well as includes. If a compile or link error reports an unresolved NSS symbol, search for and import the matching real NSS.cand header before considering anything else. - Do not write semantic wrappers or local replacement models for NSS namespace,
XATTR, trustee or AdminVol logic. Trustees are serialized through
netware.metadata/zNW_metadata_s.nwm_trustee[]; do not invent an activenetware.trusteesoruser.netware.trusteesxattr. The only acceptable wrappers/adaptations are narrow userspace ports for kernel/OS boundaries such as spinlocks, allocation, wait/schedule hooks, WIO/console output and similar platform plumbing. - For namespace, target the real
public_core/comn/namespacecode and its real dependencies underpublic_core/comn/common,public_core/nss/lib,shared/sdk/include,shared/sdk/internal,shared/sdk/publicandshared/sdk/comnSA. Keep thesrc/nwnsslayout aligned with the originalpublic_coretree, and keep theinclude/nwnsslayout aligned with the originalshared/sdktree. - AdminVol is a later target because
nameSpace.creaches AdminVol and AdminVol reaches Beast/common code. Before AdminVol cleanup, import the XATTR/EA/ metadata side intolibnwnssfrom the original NSS archives so laternwfscan consume real NSS structures and functions instead of keeping local semantic copies. libnwnssmust become a userspace NSS semantics library, not a hidden NSS disk implementation. Do not import block-device, VFS or NSS-disk-layout I/O blindly. Preserve original disk/VFS-shaped code where possible, but place HostFS, OtherFS, sidecar, FUSE andio_uringpolicy in explicit parallel*Userspace.c/*Userspace.hboundary files. Public userspace APIs should use libnwnss handles or backend contexts, not real Linux-kernelstruct dentry,struct inodeorstruct super_blockas ABI._ADMINis expected to become virtual/in-memory semantics inlibnwnssand later a userspacenwadminvolprocess served via IPC fromnwconn/nwfs, with the volume-numbering ruleSYS = 0,_ADMIN = 1, further volumes from2.- Keep
src/namspace.cas NCP glue over the future namespace engine. Do not expand old MARSnamedos/nameos2as the long-term solution; they are replacement targets. - Namespace pure helpers can stay provider-shaped in
libnwnss: compare, wildcard match/replace, ASCII/Unicode conversion, legal-name checks and component scan for DOS, LONG/OS2, UNIX/NFS, MAC, DATASTREAM and EA.*_generateUniqueName()is not a pure string helper; it needs directory uniqueness lookup. Preserve the original NSS namespace files and put HostFS, OtherFS, sidecar or Mars directory-collision policy in a parallelnameSpaceUserspace.c/nameSpaceUserspace.hboundary when that path is implemented.
NCP notation rule
Always write NCP groups/selectors with both decimal and wire/code hex when recording protocol details. Examples:
- decimal 87 == wire/code
0x57 - decimal 90/12 == wire/code
0x5a/0x0c - decimal 123/70 == wire/code
0x7b/0x46
Use ENDPOINTS.md, the NDK Core Protocols PDF, WebSDK docs and SDK includes as
references. NetWare 3.x/default compatibility has priority over broad 4.x/NDS
work.
Patch workflow
- Make small, reviewable patches with one clear subject.
- Inspect current sources before editing; no speculative patching.
- Run at least
git diff --checkbefore exporting a patch. - Also run syntax/build/test checks that match the touched files when feasible.
- Export only the
.patchfile by default when producing repository changes. Do not create or link a bundle unless the user explicitly asks for one. - Every repository patch must update this
AI.mdwith the new final commit subject in the current patch marker before exporting the patch. If the user later uploads a bundle from their repository, the marker makes that bundle self-identifying even when old chat downloads have expired or are unavailable. - Every repository patch must also replace the single
Current patch handoff blockin this file with a short description of what the patch was meant to do. Replace the old block; do not append a new one for every patch. - Always include a copy/paste
git am <patch-name>.patchcommand in the user response next to the patch download link. This is part of the handoff contract, not an optional nicety. - Generate patch mail headers with
Mario Fetka <mario.fetka@disconnected-by-peer.at>as the author identity, not an AI/OpenAI identity. - Do not claim a build/test passed unless it actually ran in the current work tree.
Source/layout rules
- Keep imported NSS sources in
libnwnss, notlibnwcore.libnwcoreis Mars-core only and must not link againstlibnwnssmerely because NSS runtime code exists. NSS tests should be namednwnss.*; core tests should only cover real Mars core helpers such as INI/logging. - Preserve original NSS API names and original filenames wherever possible.
Import real NSS files from their provenance paths and keep the new layout
recognizable:
public_core/library/...->src/nwnss/library/...,public_core/nss/...->src/nwnss/nss/...,public_core/comn/...->src/nwnss/comn/...;shared/sdk/include/...->include/nwnss/include/...,shared/sdk/internal/...->include/nwnss/internal/...,shared/sdk/public/...->include/nwnss/public/..., andshared/sdk/comnSA/...->include/nwnss/comnSA/.... - GPL-2.0-only source imports are allowed when the imported source permits GPLv2 use and the original provenance/license headers are preserved. For Linux kernel reference material, record that mars-nwe selects GPL-2.0-only.
- Clean NSS staging incrementally. Staging/reference copies under
nwfsshould not remain just because they are confusing; keep only active Mars adaptation code there. When a file is needed, import the real NSS source/header intolibnwnssin the provenance-preserving layout. - Do not import broad NSS/OES subsystems blindly, but also do not replace missing NSS symbols with local semantic wrappers. Use unresolved symbols and original Makefile object lists to find the next real bottom-up dependency. Only kernel, VFS, memory-tracking and platform hooks may get small userspace glue.
include/nwnss/librarymust not be exported as a PUBLIC CMake include directory. Doing so shadows host headers such as<stdlib.h>and<ctype.h>, breaking tests that depend oninclude_nextor libc symbols. NSS sources inside the build use the private dir; external users reference headers through explicit sub-paths such as<library/xString.h>or<include/omni.h>.include/nwnss/internal/holds Mars-private NSS compat headers that must not become public API:spinlock.h,nssSourceCompat.h,nssZosCompat.h.src/nwnss/sharedsrc/*.c.hare NSS shared-source implementation fragments. They must stay in the source tree; do not move them toinclude/.- Ports (files not from original NSS archives) must be labeled PORT in
nwnss-audit.mdwith a reason. Known ports:rbpTree.c,rand.c,strtol.c,utcUserland.c, allocator wrappers,wio.cuserspace boundary,nebEventPort.c, Unicode TAB data (GENERATED PORT DATA from Unicode.org, not Novell blobs). When a PORT entry is found during audit, search for original.corsharedsrc/*.c.hbefore accepting the port as final. - For LSA/XAttr/COMN I/O backend work, and for every future NSS function that
needs a companion layer, keep imported original files focused on original
control flow and small dispatch points. Choose the companion suffix by role:
*Userspace.c/*.his only for libnwfs/Mars-NCP/OtherFS/HostFS-facing adapter boundaries;*Fuse.c/*.his for FUSE/nwnssmount-facing callbacks;*IoUring.c/*.his for concrete Linux direct/block/file I/O execution;*Runtime.c/*.his for NSS runtime semantics that replace former kernel helpers inside the library. If both policy selection and direct I/O are needed, the Userspace/Fuse boundary chooses the path and the IoUring companion performs only the io_uring-specific work. Shared helper files should useNss*names such asNssIoUring.c,NssFuse.corNssRuntime.c, notnwnss*file names. Preprocessor/CMake switches inside the NSS path must also use genericNSS_*names, notMARS_NWE_NWNSS_*.virtualIOis already the NSS_ADMIN/management virtual-file layer; do not reuse that name for future disk/block/io_uring backends. *Userspace.c/*Userspace.hcompanion files are ALLOWED only when they sit alongside the matching imported original and carry libnwfs/Mars-NCP/OtherFS/ HostFS adaptation that must not go inline, for examplenameSpaceUserspace.c,lsaXattrUserspace.c,dirQuotasUserspace.corsalvageUserspace.c. Collector/stub-filler files such as the rejectedncpNdpUserspace.cor the supersededvirtualIOUserspace.care FORBIDDEN: a*Userspace.cthat exists only to provide symbols that should come from a real original.corsharedsrc/*.c.his a stub depot. Always search the original archives first.- Default
libnwnssmay use: AdminVol, AdminFS, VirtualIO (management/template/ function data streams), in-memory/callback streams, and pure NSS management callbacks. Real NSS disk-layout I/O, block-device I/O, Kernel VFS I/O, and cache/file-handle paths that go directly to disk/block/kernel FS require theNSS_BLOCK_IOguard and a future backend context (io_uring, SPDK). Do not route backend storage throughvirtualIO; that name is taken. Do not useNOT_SUPPORTEDto silence Virtual/AdminVol/Callback-IO paths; guard only real block/disk paths. libnwfsis the Mars/NCP file compatibility wrapper, not the NSS provider and not the owner of future storage backends. It translates Mars/NCP file, namespace, quota, salvage, stream and XAttr operations intolibnwnssprovider calls, then adapts the result to Mars wire/reply and host persistence rules. Existing half-finishednwfsstaging remains ignored duringlibnwnssimport work and should later be removed, replaced or adapted as wrapper code.libnwnssowns NSS provider semantics and the future real NSS backend boundaries. Keep their companion roles distinct:*Userspace.c/*.hfor libnwfs/Mars/OtherFS/HostFS adaptation,*Fuse.c/*.hfor nwnssmount/FUSE callbacks,*IoUring.c/*.hfor concrete direct I/O, and*Runtime.c/*.hfor NSS cache/workqueue/wait/dirty runtime semantics.nwnssmountis the future FUSE mount consumer oflibnwnss;nwnssmuis the future TUI management utility for admin, inspect, repair, quota, salvage, namespace and XAttr operations.libnwbindis for bindery identity/storage. NDS/eDirectory compatibility belongs in a futurelibnwnds, backed bylibnwdirectory;nwdirectoryis the LDAP/TinyLDAP-based directory server. Annwndsprocess may be added later only when cross-process NDS state, caching, auth brokering, events or background jobs need a supervised service.
Service and provider ownership rules
nwservis the governor/control-plane supervisor for the Mars process tree. It starts and monitors processes such asnwconn,nwdirectoryand later optional provider services. It is not the NCP server and should not become the normal data-plane router for decoded NCP payloads.nwconnis the NCP server process. It owns client NCP request parsing and NCP reply construction. For file/volume operations it should calllibnwfs; for future NDS/eDirectory identity, authentication, trustee and security equivalence work it should calllibnwnds.libnwfsis the Mars/NCP file wrapper aroundlibnwnss. Keep Mars wire parsing, NCP reply packing, Mars volume options and HostFS/OtherFS adaptation there; keep NSS semantics inlibnwnss.libnwndsis the planned NDS/eDirectory compatibility library. It translates NetWare concepts such as DN, GUID, UserID, Security Equivalence Vector, tree context, object/class/attribute mapping and trustee identity lookup tolibnwdirectory. Do not hide LDAP/eDirectory policy inlibnwnssorlibnwfs.libnwdirectoryis the library/client layer fornwdirectory;nwdirectoryis the LDAP/TinyLDAP-based directory server.- NSS headers such as
eDir.h,ncpIDAPI.handndp_idbroker.hare boundary references for GUID/DN/UserID/SEV mapping. They are not a full eDirectory backend and should point towardlibnwnds, not toward new directory policy inlibnwnss. - NSS
encp.his useful as an NCP wire/layout reference for Mars header convergence, especially namespace, quota, trustee and salvage layouts. Do not cast Mars byte buffers directly to imported NSS structs; use byte-safe parser/builder wrappers or compatibility aliases.
Namespace rules
- Do not expand old MARS
namedos/nameos2as the long-term solution. They are replacement targets. - Import/adapt the NSS namespace engine directly in
libnwnss, then retire old MARS namespace logic after tests cover DOS/LONG behaviour. Missing namespace dependencies must be resolved from the original NSS sources, not by adding replacement wrappers. - Stable namespace state belongs in
netware.metadata: file ID, parent file ID, DOS name, LONG/OS2 name, MAC name, UNIX/backend name, casefold/hash fields and namespace flags.*_generateUniqueName()must use the generic userspace companion-file pattern when it needs HostFS/OtherFS directory collision lookup or metadata/xattr-backed namespace state; do not put that lookup directly into the original NSS namespace source files. - Existing Linux files created by Samba, rsync or local admin tools must be reconciled by libnwfs watcher/scanner work, not by a private side database.
- MAC namespace is a namespace/stream/metadata problem, not a transport problem. Resource forks and Finder info belong in streams/metadata later.
Salvage/recycle rules
- Keep
.recycleas the Samba-compatible deleted-payload backend. - Make
netware.metadataon the recycled payload authoritative for deleted state. - Treat
.salvageJSON as legacy migration/debug data only; do not make it a second long-term authority. - Samba
vfs_recyclenormally uses rename, so xattrs remain attached to the recycled inode. Manually copied files in.recyclewithoutnetware.metadataare not valid NetWare salvage objects unless an explicit admin repair tool marks them. - If a compressed file is recycled, the
.recyclepayload should be a normal uncompressed Linux file; keep previous compression state innetware.metadata.
Compression and stream rules
- Compression belongs in
libnwfs, notlibnwcore. - Future private stream/compression data belongs under
.nwfs_streams/<stable-file-id>/.... - The stable file ID comes from MARS/NWFS/NSS-shaped metadata, not from Linux inode numbers and not from visible filenames.
- Do not encode compression state in visible names such as
compressed_*.
Transport rules
- TCP/IP is implemented in
libnwtransport, a library thatnwconnlinks against; it is not a new daemon. - Planned files:
src/nwtransport.c,src/nwipx.c, latersrc/nwtcp.c. - NCP providers stay transport-neutral:
IPX/TCP -> nwtransport -> nwconn -> dispatcher -> providers. - Use audited libowfat API names from the bundled
mars-libowfatsource:socket_tcp4(),socket_tcp6(),socket_bind4_reuse(),socket_bind6_reuse(),socket_listen(), nonblocking accept helpers andio_*readiness helpers. - IPX config sections use frame tokens without dots:
8022,8023,etherii,snap,tr8022,auto. [transport.ipx.local]is the internal network; explicit routes use[transport.ipx.route.<target>].- If IPX is requested but
socket(AF_IPX, ...)fails, report that AF_IPX is unavailable instead of silently falling back. - A future L2 IPX backend is allowed, but it is an additional backend below
nwtransport, not a replacement for the kernel path. Start with Ethernet_II IPX, SAP/RIP, and NCP socket0x0451. - Do not vendor a capability library for L2 IPX. Open the packet socket and
report missing
CAP_NET_RAW/CAP_NET_ADMIN; root, setcap, or systemd capabilities are deployment policy. - Do not copy GPL-3.0-or-later code from the Rust
nwserverreference. Use only the observed architecture: userland Ethernet/IPX packet handling, SAP/RIP, and NCP socket dispatch. - SPX, if needed, is a later userland layer above IPX. Do not rely on kernel SPX and do not make namespace work wait for SPX.
- Linux 2.4.37.9 SPX is imported only as reference material in
src/kernel/af_spx.candinclude/kernel/spx.h; do not build it as-is.
Dependency/source bundle rules
mars-nwe-masteris the root repository.- Uploaded
mars-*bundles are submodules/sibling components needed in the configured locations. - Offline point-release tarballs are staged by
prepare-local-deps.sh. In a new chat or clean checkout, use this script as the first dependency/bootstrap step before CMake/build attempts:yyjson-0.12.0intothird_party/yyjsonlibsodium-1.0.20into the nested libsodium snapshot pathgdbm-1.26built locally under.local-deps/prefix- PAM and ncurses headers staged while linking to system libraries
- Do not vendor random system headers directly into endpoint/provider code.
Reference archives
The following archives were used for the NSS import/audit work and are available for further namespace implementation and NCP structure verification:
nss-common.tar.bz2nss.tar.bz2ncp__enu.pdfwebsdk.tar.gzinclude.tar.gz
Networked CTest skip policy
Server-dependent NCPFS/AFP/salvage/quota smokes must be visible in CTest but
must not fail ordinary offline builds. Register them with the
networked;integration labels and SKIP_RETURN_CODE 77. The test launcher
prints SKIP/WARN and exits 77 unless MARS_NWE_RUN_NETWORKED_TESTS=1 and the
required MARS_NWE_TEST_* environment variables are present. Use
ctest -LE networked for offline unit coverage and ctest -L networked for
server-backed integration runs. When the TCP/IP transport test harness lands,
these CTest entries become the path for real local execution.