WIP: Add native SHA-2 hashing through shared command clients #2

Closed
erikinkinen wants to merge 52 commits from feature/posix-compat into main
Owner

Summary and rationale

Run the shared SHA-256 and SHA-512 command on EriX through explicit native file and stream clients. The Linux backend keeps the same grammar, digest records and exit statuses. Complete parsing precedes input binding, and file length does not determine temporary memory use.

Tracking and scope

Native image packaging and guest file/stdin/redirection and denied-authority scenarios remain open.

Architecture, authority and failure behavior

The native entry validates the authenticated startup, command entry, descriptor bindings and complete capability inventory. Selected file operands request exact invocation-lifetime READ leases through the inherited job broker; stdin is consumed at most once. No filesystem root, lifecycle, clock, network or launch route is needed. Output uses selected inherited descriptors only.

Digest finalization requires confirmed EOF and successful input retirement. Original grants and shared stream cursors survive through cleanup; uncertain calls are never replayed. The first operation and cleanup observations remain distinct, and unresolved owners stay alive at the fail-stop boundary.

Native allocations use one explicitly packaged writable workspace. The recycling allocator's unsafe operations are confined to that original mapped arena; transport and input buffers have exclusive execution-long borrows. There is no libc or host-helper fallback.

Validation evidence

New wire and lifecycle controls are authored. Matching component, native-target, parity and guest acceptance remain open; earlier host results cover their original revisions.

Review checklist

  • Original implementation uses EriX dependencies tracking main.
  • Signed commits explain the native client and cleanup contracts.
  • Public APIs have rustdoc; authored code files remain below 1,000 lines.
  • Component documentation and the technical manual describe the backend.
  • Complete matching native and guest acceptance.

Keep this review WIP until its remaining scope is complete.

## Summary and rationale Run the shared SHA-256 and SHA-512 command on EriX through explicit native file and stream clients. The Linux backend keeps the same grammar, digest records and exit statuses. Complete parsing precedes input binding, and file length does not determine temporary memory use. ## Tracking and scope - [Native backend design](https://git.erikinkinen.fi/erix/sha2-tool/issues/4) and [component audit](https://git.erikinkinen.fi/erix/sha2-tool/issues/1) - [LibCli](https://git.erikinkinen.fi/erix/lib-cli/pulls/2), [LibStdio](https://git.erikinkinen.fi/erix/lib-stdio/pulls/2) and [Coreutils](https://git.erikinkinen.fi/erix/coreutils/pulls/2) - [Integration packaging](https://git.erikinkinen.fi/erix/integration/pulls/12) and [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65) Native image packaging and guest file/stdin/redirection and denied-authority scenarios remain open. ## Architecture, authority and failure behavior The native entry validates the authenticated startup, command entry, descriptor bindings and complete capability inventory. Selected file operands request exact invocation-lifetime READ leases through the inherited job broker; stdin is consumed at most once. No filesystem root, lifecycle, clock, network or launch route is needed. Output uses selected inherited descriptors only. Digest finalization requires confirmed EOF and successful input retirement. Original grants and shared stream cursors survive through cleanup; uncertain calls are never replayed. The first operation and cleanup observations remain distinct, and unresolved owners stay alive at the fail-stop boundary. Native allocations use one explicitly packaged writable workspace. The recycling allocator's unsafe operations are confined to that original mapped arena; transport and input buffers have exclusive execution-long borrows. There is no libc or host-helper fallback. ## Validation evidence New wire and lifecycle controls are authored. Matching component, native-target, parity and guest acceptance remain open; earlier host results cover their original revisions. ## Review checklist - [x] Original implementation uses EriX dependencies tracking `main`. - [x] Signed commits explain the native client and cleanup contracts. - [x] Public APIs have rustdoc; authored code files remain below 1,000 lines. - [x] Component documentation and the technical manual describe the backend. - [ ] Complete matching native and guest acceptance. Keep this review WIP until its remaining scope is complete.
build: Align dependencies for coherent runtime adoption
All checks were successful
CI / markdown (push) Successful in 10s
CI / test (push) Successful in 26s
CI / markdown (pull_request) Successful in 10s
CI / test (pull_request) Successful in 27s
753439423c
Select the current original signed foundation commits in the existing Git
dependencies. Keep Rust implementation files unchanged and record the
separate product-image acceptance requirement in the roadmap.

The complete supported feature/profile matrix passes with formatting,
strict Clippy, unit tests, builds and private rustdoc. Product runtime
adoption remains pending the complete dependency graph.
ci: Skip duplicate same-repository pull request jobs
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 7s
CI / test (push) Successful in 25s
4e1295a907
Skip pull-request jobs when the head and base repository names match,
since push CI already covers these branches. Retain fork pull-request,
push and manual execution and existing release publication conditions.
Apply the guard before any job steps, including Markdown validation.

Test execution and CI observation are deferred at the user's request;
no execution result is claimed for this workflow-only change.
build: Adopt original-custody filesystem revisions
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 8s
CI / test (push) Successful in 27s
63a0c8f7e2
Select complete signed native filesystem and compatibility dependencies by
immutable commit. Preserve original endpoints, rights, cleanup and resource
budgets throughout the coherent compilation graph.

Tests, builds, lint checks, generated documentation, VM/profiler execution and
CI observation remain deferred. Rustfmt was applied through stdin. No test
pass, warning-free build or measured performance improvement is claimed.
Full EriX guest generations and external Rust/LLVM guest rebuilding remain
required and unperformed.
build: Adopt original key lifetime dependencies
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 16s
CI / test (push) Failing after 1h1m43s
622160513e
Select signed original key-material lifetime dependencies by immutable
commit. Preserve endpoints, grants, resource budgets and existing
duplicate same-repository PR conditions throughout the compilation graph.

Tests, builds, lint checks, generated documentation, VM/profiler execution and
CI observation remain deferred. Rustfmt was applied through stdin. No test
pass, warning-free build or measured performance improvement is claimed.
Full EriX guest generations and external Rust/LLVM guest rebuilding remain
required and unperformed.
ci: Adopt the signed original Git dependency helper
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 6s
CI / test (push) Failing after 14s
c654d5b944
Select the verified immutable Integration helper that preserves actual
Git objects and denies registry dependencies without obsolete path
patches. Retain every duplicate same-repository PR guard. Where needed,
adopt the coherent signed ABI graph and preserve original authority and
validation budgets. Maintain canonical documentation formatting.

Tests and exact-head CI run in parallel with implementation. Earlier failed,
skipped or unrun checks remain distinct from actual passes. Keep the full
EriX guest build generations and external Rust/LLVM guest rebuild required;
no final all-repository CI success or guest completion is claimed.
ci: Adopt the signed original Git dependency helper
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 5s
CI / test (push) Failing after 12s
b4c8c00629
Select the verified immutable Integration helper that preserves actual
Git objects and denies registry dependencies without obsolete path
patches. Retain every duplicate same-repository PR guard. Where needed,
adopt the coherent signed ABI graph and preserve original authority and
validation budgets. Maintain canonical documentation formatting.

Tests and exact-head CI run in parallel with implementation. Earlier failed,
skipped or unrun checks remain distinct from actual passes. Keep the full
EriX guest build generations and external Rust/LLVM guest rebuild required;
no final all-repository CI success or guest completion is claimed.
build: Refresh the locked signed digest-tool dependency graph
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Successful in 9s
5be25ec465
Generate the binary lockfile from the actual newly selected full commit hashes.
Preserve canonical original Git objects and registry denial; no branch, path or
replacement source is selected. Keep locked CI reproducible after the helper
and dependency update. Exact signed-head validation runs independently.
build: Align consumer inputs with the signed library graph
All checks were successful
CI / markdown (pull_request) Has been skipped
CI / test (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Successful in 13s
380a8f42cc
Select the current actual library commits and preserve original Git
source identities. Keep the compiled Integration helper on its
independent reviewed revision so transitive ABI types agree.
ci: Select the reviewed native process custody helper
Some checks failed
CI / markdown (pull_request) Has been skipped
CI / test (pull_request) Has been skipped
CI / markdown (push) Successful in 5s
CI / test (push) Failing after 10s
bc203154b7
Select the coherent Integration source for dependency preparation and
native process ownership. This keeps helper inputs aligned with the
published runtime producer and refuses unsupported descriptor queries
before starting a child.
ci: Adopt the repaired native signal owner
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 10s
CI / test (push) Successful in 21s
2c02dadc34
Select the coherent Integration helper that admits observed default or
ignored reserved signals while preserving complete native action identity.
Keep the existing workflow commands and limits for Integration #118.
Declare main for internal Git dependencies. Prepare offline Cargo inputs with
the selected Integration helper, then carry the generated workspace, environment
and target directory through each CI step.

Keep shared dependency and review policies aligned.

Refs: erix/integration#142
build: regenerate the main dependency lockfile
Some checks are pending
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 19s
CI / test (push) Has started running
2bfd2bd087
Regenerate Cargo.lock after switching internal dependencies to main. Keep
the resolved commits recorded in the lockfile.

Refs erix/integration#142
ci: Select the repaired Cargo gateway
Some checks are pending
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / test (push) Has started running
CI / markdown (push) Has started running
35b430060c
Use the shared gateway that selects installed Rust tools when a component
has no toolchain file. Keep tool selection, feature-branch resolution and
original source checks together in the pinned helper snapshot.

Refs: erix/integration#147
ci: Use the shared acquisition fix for packed Git transfers
Some checks are pending
CI / markdown (pull_request) Has been skipped
CI / test (pull_request) Has been skipped
CI / test (push) Successful in 2m0s
CI / markdown (push) Has started running
47ce6d3ae7
Use the shared acquisition fix for packed Git transfers. The pinned helper
keeps unexpected object-store metadata outside the acquired source context.

Refs: erix/integration#150
build: Refresh main-branch dependency locks
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 5s
CI / test (push) Successful in 30s
7ea72cc65f
Keep the maintained lockfile aligned with the published dependency revisions.
Use the whole lockfile generated by offline Cargo against the selected original
Git objects; preserve the main-branch dependency declarations.

Refs erix/integration#142.
Keep parsing, digest state and record formatting in a no_std library, with
streaming input and output supplied by an explicit backend. Preserve Linux
argument bytes and records, check help/version flush failures, and document
the native EriX capability and retirement contract.
docs: Align platform notes with the shared command library
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 28s
0864e42eee
Keep the platform contract within the numbered architecture interface
section and replace the stale unchanged-source summary. State the native
startup, file/stream and error-translation work that remains.
erikinkinen changed title from WIP: Align signed runtime dependencies to WIP: Prepare digest commands for native EriX I/O 2026-10-17 08:10:24 +02:00
Expose the selected input and stream requirements from one owned parse result.
Bind only those streams in the Linux entry and preserve the existing streaming
execution order. Document native effect errors and completion ownership.
Shorten parity-matrix labels while retaining the input, transport, partial-I/O
and cleanup cases. Preserve the native error grammar and shared tool behavior.
docs: Shorten the help parity case
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 23s
b4b127ac77
Keep the help and syntax case within the existing table width while preserving
the required status, response and absence of file effects.
Expose each selected input with its position in the original command line.
Keep duplicate paths and their original byte allocations distinct so native
entry can compare operands with producer associations before binding owners.
The projection performs no I/O and conveys no capability.
Keep the option-terminator regression aligned with retained operand records
and assert the original argument position alongside the unchanged raw bytes.
style: Wrap the operand parser imports
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 4s
CI / test (push) Successful in 28s
9d350f9e9b
Group the expanded parser imports using the formatter's line wrapping.
The retained operand position and raw-byte expectations are unchanged.
Author
Owner

Prepared input occurrences now retain their original argument indices. Repeated paths, stdin operands and non-UTF-8 bytes keep their exact positions and borrowed buffers. This gives the native backend a way to match each operand to its producer-supplied association.

Prepared input occurrences now retain their original argument indices. Repeated paths, stdin operands and non-UTF-8 bytes keep their exact positions and borrowed buffers. This gives the native backend a way to match each operand to its producer-supplied association.
docs: Publish the complete digest command manual
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 3s
CI / test (push) Successful in 30s
5204253ce8
Add the owning section-1 page and explicit source-bound inventory for offline
packaging. Cover the implemented grammar, record bytes, errors, examples and
Linux/native authority boundary, with current-source freshness checks in CI.

Refs #1
Author
Owner

Added the complete offline command page and source bindings in 5204253. The page describes the existing Linux executable and shared library without claiming a finished native backend.

Added the complete offline command page and source bindings in [5204253](https://git.erikinkinen.fi/erix/sha2-tool/commit/5204253ce8c2f84fad8f5b9cf02ffb493a51c865). The page describes the existing Linux executable and shared library without claiming a finished native backend.
docs: wrap manual overview prose
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 36s
9544bb7a8c
Keep the command overview within the documentation line width.
Add explicit native startup, selected file and stream owners, exact lease retirement and a recycling deployment workspace. Preserve the shared command grammar and records, with original failure custody through final cleanup.

Refs #4.
Move the optional clients into the dependency table and use the syscall package
name exported by LibIPC. Keep the manual source binding current.

Refs #4.
fix: retain native cleanup custody and exact failures
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 2s
CI / test (push) Successful in 59s
140f0ef82e
Dispose unused fixed stream aliases once before ordinary work. Preserve exact cleanup observations and the complete original owner, with effect-free successful finish repetition.

Refs #4.
erikinkinen changed title from WIP: Prepare digest commands for native EriX I/O to WIP: Add native SHA-2 hashing through shared command clients 2026-10-24 03:32:12 +02:00
docs: wrap native ownership paragraph
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 1m11s
60c20fe8c2
Keep the native ownership description within the document line width.
Install the packaged process workspace once in LibOwnedRegion and remove the duplicate private allocator. Keep marker geometry and original mapping lifetime explicit without acquiring or replacing backing.

Refs #4.
Compile the optional native allocator adapter only when native-runtime is selected. Ordinary hosted tests retain their default dependency boundary.

Refs #4.
docs: bind the native manual to its original IO source
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Failing after 20s
4008704074
Correct the source fingerprint to the genuine unchanged adapter body. Preserve the actual source and the explicit manual freshness contract.

Refs #4.
fix: retire unused SHA file brokers before stream work
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 7s
CI / test (push) Failing after 36s
60d25df543
Commands without selected files now dispose their original READ broker before
output or stdin access. Preserve one retirement attempt and the exact first
failure in the original owner; keep the route for any later file operand.
Document the boundary and cover responses, stdin, file order and cleanup.

Refs #4.
ci: Select helpers with the shared allocator source
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 4s
CI / test (push) Successful in 1m15s
d9a9c86486
Use the published Integration catalog that includes LibOwnedRegion so native
SHA dependency preparation can resolve its new main-branch dependency.
The previous helper stops before compilation because that source is absent.
Bind LibCli's adapter to the original admitted startup and remove the private
stream and broker forwarding implementation. Keep native failure width and
original invocation custody in the shared implementation.
Use LibCli for original workspace admission and the final owner-retaining exit boundary. Keep the actual startup and complete native observations alive across refusal, and remove the private helper copies.
Fence the original receiver before disposing its local sender, and observe only that same retirement while pending. Keep file issuers until their leases settle, drain inherited streams independently, and preserve original operation and broker-cleanup failures in separate evidence buffers.
Use the common allocation-free descriptions while preserving the existing failure fields and command output. Original packets and broker cleanup remain with the native client.
Apply the repository formatter to the native test imports and broker retirement assertions so the expanded cleanup coverage follows the shared Rust style.
Bind complete expectation triples to original invocation arguments and bound each native input before reading. Emit a verdict only after genuine source completion and positive input retirement.
Bind no cursor or capability for explicitly closed roles. Preserve the first local operation failure and retire independent original streams without treating closed input as EOF.
Update native intake cases and documentation for the ordinary child layout. Cover receiver refusal before queries, complete inventory checks and original receipt identity.
fix: Retire inherited streams by their original ownership kind
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 11s
CI / test (push) Failing after 35s
16746fc38e
Use authenticated per-description ownership to cancel borrowed views and close owned channels. Observe only an unused duplex half before its close, and retain pending callback state and independent error packets throughout teardown.
docs: Bind the manual to current recipient-view sources
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 9s
CI / test (push) Failing after 2m21s
b73ec75d54
Refresh the three changed source digests in the existing manual inventory. Describe checked base-plus-length arithmetic and refusal before narrowing or body access, preserving all inventory entries and authority requirements.
refactor: Remove unused cleanup construction and redundant borrowing
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 13s
CI / test (push) Failing after 1m53s
023071fbca
Use the existing first-cause constructor in the cleanup diagnostic fixture, retaining its packet and message assertions. Remove the redundant argument borrow and refresh the two changed manual source bindings.
refactor: Forward checked input open errors directly
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 6s
CI / test (push) Failing after 25s
bb11a48438
Preserve the original open failure before registering any descriptor, then retain the existing read and retirement sequence.
docs: Bind the manual to the current source
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 4s
CI / test (push) Failing after 1m12s
6a7cc54fc0
Refresh the exact source digest for src/linux/verification.rs after its corresponding source change.
test: Prepare the independent rejected stream invocation
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 6s
CI / test (push) Failing after 1m40s
73fe5851ec
Execution consumes its prepared command. Construct a separate plan from the same explicit arguments for the refusal case and preserve the zero-effect and once-only admission checks.
test: Import the verification vector macro explicitly
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 4s
CI / test (push) Failing after 1m34s
1d5a7c231b
Keep the allocation-backed digest grammar controls available in the no_std test module without relying on a host macro prelude.
test: Expect canonical hexadecimal path escapes
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Failing after 58s
8cd55e8e92
Keep the independent verdict literal aligned with the documented byte escaping while preserving the original raw path and uppercase digest input.
test: Match native receipt slots and grant retirement
Some checks failed
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / test (push) Failing after 53s
fa797f548f
Place inherited views at their canonical startup slots and return new file receipts at the requested empty destination. Keep the issuer grant separate from local alias disposal so uncertain Release still prevents broker retirement. Update the retained-workspace catalog oracle and parse exact startup record headers.
test: Keep the diagnostic-only help oracle current
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 1m10s
ef860d460c
Check the complete final help lines after the zero-record description while retaining the original usage-error status, diagnostic authority and zero input/output effects.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:13 +01:00
Author
Owner

This source is now split into feature PRs, starting at #8 and ending at #27. Each PR links its prerequisite. The complete stack preserves the runtime changes and dependency declarations; obsolete pin checkpoints and documented source-acquisition differences are separated from feature behavior.

Closing this aggregate without merging. The replacement PRs remain WIP for their remaining integration and review.

This source is now split into feature PRs, starting at #8 and ending at #27. Each PR links its prerequisite. The complete stack preserves the runtime changes and dependency declarations; obsolete pin checkpoints and documented source-acquisition differences are separated from feature behavior. Closing this aggregate without merging. The replacement PRs remain WIP for their remaining integration and review.
erikinkinen closed this pull request 2026-10-30 18:05:35 +01:00
All checks were successful
CI / test (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / test (push) Successful in 1m10s

Pull request closed

Sign in to join this conversation.
No description provided.