feat: export the library surface for dependents #124

Merged
binjovi-bot merged 1 commit from feat/library-surface into trunk 2026-09-14 04:29:54 +00:00
Owner

zelnet becomes importable as a Zig package. build.zig declares the library with addModule. Two modules join root.zig for library callers: source, the strict source-capture engine behind src export, now generic over the transport and the output sink; and hostsession, one authenticated session that opens the file, remote-command and database services on first use and returns errors instead of ending the process. database.runSelectDiag and runExecImmediateDiag return the SQLCA diagnostics through SqlDiag.

The CLI does not change: src export keeps its directory sink, its stderr lines and its capture.json bytes (a golden test pins the shape). make ci passes: format, Debug and ReleaseSafe tests, and the Binjovi package contract.

The first consumer is sean/sourcerer, the IBM i source-control CLI.

https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV

`zelnet` becomes importable as a Zig package. `build.zig` declares the library with `addModule`. Two modules join `root.zig` for library callers: `source`, the strict source-capture engine behind `src export`, now generic over the transport and the output sink; and `hostsession`, one authenticated session that opens the file, remote-command and database services on first use and returns errors instead of ending the process. `database.runSelectDiag` and `runExecImmediateDiag` return the SQLCA diagnostics through `SqlDiag`. The CLI does not change: `src export` keeps its directory sink, its stderr lines and its `capture.json` bytes (a golden test pins the shape). `make ci` passes: format, Debug and ReleaseSafe tests, and the Binjovi package contract. The first consumer is `sean/sourcerer`, the IBM i source-control CLI. https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV
feat: export the library surface for dependents
All checks were successful
binjovi/ci Binjovi completed the frozen plan
a4d1c3173d
`zelnet` becomes importable as a Zig package. build.zig declares the
library with addModule, so a dependent can write
`b.dependency("zelnet", .{}).module("zelnet")`.

Two modules join root.zig for library callers:

- `source` is the strict source-capture engine behind `src export`,
  lifted out of host.zig. It is generic over the transport and the
  output sink, so a test can drive it with an in-memory host and a
  library can write members wherever it wants. The CLI keeps a
  directory sink and the same stderr progress lines. The capture.json
  bytes do not change; a golden test pins the shape.
- `hostsession` signs on once and opens the file, remote-command and
  database services on first use. It returns errors and never ends the
  process, unlike the CLI verb helpers.

`database.runSelectDiag` and `runExecImmediateDiag` hand the SQLCA
status, SQLCODE and message to the caller through `SqlDiag`; the
existing functions keep printing as before. `readSqlca` has happy,
absent, short and oversized-length tests.

The first consumer is sean/sourcerer, the IBM i source-control CLI.
`make ci` passes: format, Debug and ReleaseSafe tests, and the Binjovi
package contract.

Claude-Session: https://claude.ai/code/session_01HPdKaFBKQVs8hzfgXMrnwV
binjovi-bot deleted branch feat/library-surface 2026-09-14 04:29:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/zelnet!124
No description provided.