Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ arch:
# Engine-bound: stage STDASSERT (+ harness) from m-stdlib so VSL*TST suites
# resolve ^STDASSERT. Pass --engine ydb|iris and --docker <container>.
test:
$(M) test $(ENGINE_FLAGS) --routines $(MSTDLIB)/src $(TESTS)
$(M) test $(ENGINE_FLAGS) --routines $(SRC) --routines $(MSTDLIB)/src $(TESTS)

coverage:
$(M) coverage $(ENGINE_FLAGS) --routines $(MSTDLIB)/src --min-percent=85 $(SRC) $(TESTS)
Expand Down
22 changes: 22 additions & 0 deletions dist/icr-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,27 @@
},
"status": "Supported"
}
],
"VSLIO": [
{
"call": "CALL^%ZISTCP",
"custodian": "XU",
"icr": 2118,
"source": {
"anchor": "callzistcp-make-tcpip-connection-remote-system",
"doc_key": "XU/krn_8_0_dg_device_handler_ug"
},
"status": "Supported"
},
{
"call": "CLOSE^%ZISTCP",
"custodian": "XU",
"icr": 2118,
"source": {
"anchor": "closezistcp-close-tcpip-connection-remote-system",
"doc_key": "XU/krn_8_0_dg_device_handler_ug"
},
"status": "Supported"
}
]
}
132 changes: 131 additions & 1 deletion dist/msl-seam-pin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msl_ref": "v0.7.0",
"msl_ref": "v0.8.0",
"seams": {
"STDENV": {
"contract_version": 1,
Expand Down Expand Up @@ -30,6 +30,136 @@
}
}
]
},
"STDNET": {
"contract_version": 1,
"entry_points": [
{
"args": [
{
"doc": "a listener handle from $$listen",
"name": "id",
"type": "numeric"
},
{
"doc": "seconds to wait for a connection",
"name": "timeout",
"type": "numeric"
}
],
"label": "$$accept^STDNET(id, timeout)",
"raises": [],
"returns": {
"doc": "a connected handle (>0), or 0 on timeout/failure",
"type": "numeric"
}
},
{
"args": [
{
"doc": "a handle from $$listen/$$accept/$$connect",
"name": "id",
"type": "numeric"
}
],
"label": "$$close^STDNET(id)",
"raises": [],
"returns": {
"doc": "1 (idempotent)",
"type": "bool"
}
},
{
"args": [
{
"doc": "host/IP to connect to",
"name": "host",
"type": "string"
},
{
"doc": "TCP port",
"name": "port",
"type": "numeric"
},
{
"doc": "seconds to wait for the connect",
"name": "timeout",
"type": "numeric"
}
],
"label": "$$connect^STDNET(host, port, timeout)",
"raises": [],
"returns": {
"doc": "a connected handle (>0), or 0 on failure",
"type": "numeric"
}
},
{
"args": [
{
"doc": "TCP port to bind; 0 lets the OS choose",
"name": "port",
"type": "numeric"
}
],
"label": "$$listen^STDNET(port)",
"raises": [],
"returns": {
"doc": "a listener handle (>0), or 0 on failure",
"type": "numeric"
}
},
{
"args": [
{
"doc": "a connected handle",
"name": "id",
"type": "numeric"
},
{
"doc": "maximum bytes to read",
"name": "maxlen",
"type": "numeric"
},
{
"doc": "seconds to wait for data",
"name": "timeout",
"type": "numeric"
},
{
"doc": "by-ref; receives the bytes read",
"name": "buf",
"type": "string"
}
],
"label": "$$read^STDNET(id, maxlen, timeout, buf)",
"raises": [],
"returns": {
"doc": "bytes read (0 on timeout/EOF)",
"type": "numeric"
}
},
{
"args": [
{
"doc": "a connected handle",
"name": "id",
"type": "numeric"
},
{
"doc": "bytes to write (raw, no delimiter)",
"name": "buf",
"type": "string"
}
],
"label": "$$write^STDNET(id, buf)",
"raises": [],
"returns": {
"doc": "1 on success; 0 on failure",
"type": "bool"
}
}
]
}
}
}
3 changes: 2 additions & 1 deletion dist/namespace-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"discovered": {
"globals": [],
"routines": [
"VSLCFG"
"VSLCFG",
"VSLIO"
]
}
}
1 change: 1 addition & 0 deletions docs/memory/MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ One line per memory file. Content lives in the files, not here.
- [meta-root + owed VSLSEED filer](meta-root-and-owed.md) — layer declared in **root `repo.meta.json`** (migrated off `dist/` 2026-06-15, Phase B item 1); the owed `fileViaDie^VSLSEED` FileMan filer (re-homed from m-stdlib STDSEED per the G2 waterline decision) lands here when a v-layer seeding consumer needs it.
- [t0b4-msl-seam-pin](t0b4-msl-seam-pin.md) — VSL T0b.4 (v-stdlib leg, 2026-06-15): the **cross-repo MSL seam-contract pin** — `dist/msl-seam-pin.json` (pins MSL `v0.6.0` + frozen `seams` copy) + `tools/msl_seam_pin.py` drift gate (`make check-msl-pin`). Reads the sibling MSL @ tag via `git show`; **SKIP-green when unreachable** (so it SKIPs in CI today, asserts at dev-time); fetch-at-tag path deferred to T1.1. Don't conflate with v-stdlib's own (VSL*) `dist/seam-snapshot.json`.
- [t0b3-drift-gates](t0b3-drift-gates.md) — VSL T0b.3 (v-stdlib leg, 2026-06-15): the **four drift gates** mirrored from m-stdlib (tools/ copied verbatim except gen-manifest's `VSL*` glob). All **green-empty** (no VSL* modules yet); red-on-violation proven. `repo.meta.json` gained `namespaces: {VSL}`; `ci.yml` runs them via an `m-ci.yml` caller with `engine-targets: ""` (engine-free). fmt/lint left out of CI (Makefile `M` default is a local path). Next: T0b.4 freeze+pin the seam contract.
- [m2-vslio](m2-vslio.md) — VSL/MSL **M2 Lane B DONE** (2026-06-16): `VSLIO` binds the `STDNET` socket seam (MSL **v0.8.0**) to VistA's Kernel device handler — **outbound TCP via `CALL^%ZISTCP` (ICR #2118)**; the CLIENT subset only (VistA has no Supported listen/accept; server side stays in STDNET). Re-pinned `msl_ref` v0.7.0→v0.8.0 (first real fetch-at-tag). **vehu(YDB) 10/10** (tier-1 POP=0 + tier-2 echo) · **foia-t12(IRIS) 6/6** (connect-failure proves the binding; loopback soft-skips on STDNET's deferred IRIS leg). TLS-gap loud (`$$tlsAvailable`=0, `$$connectTls` raises `U-VSLIO-NOTLS`). **KEY:** the gold doc's input-var convention for `CALL^%ZISTCP` is WRONG — it's argument-passed `CALL(IP,SOCK,TO)`; leaves the socket device CURRENT (restore `$IO`). 3 boundaries green (check-msl-pin@v0.8.0 / check-icr 4 / check-citations 4).
81 changes: 81 additions & 0 deletions docs/memory/m2-vslio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
name: m2-vslio
description: VSL/MSL M2 Lane B DONE — VSLIO binds the STDNET socket seam to VistA's Kernel device handler (outbound TCP via CALL^%ZISTCP, ICR #2118). Re-pinned msl_ref v0.7.0→v0.8.0. Tier1 POP=0 + tier2 echo GREEN on vehu(YDB); CALL^%ZISTCP wired on both engines; IRIS loopback soft-skips on STDNET's deferred IRIS leg; tier3 TLS loud-blocked. 3 boundaries green.
metadata:
type: project
---

# VSL T-M2 Lane B — VSLIO (VistA TCP transport over ^%ZISTCP), 2026-06-16

The VistA side of the M2 socket/TLS seam (S4): `VSLIO` binds the portable MSL
`STDNET` seam (MSL **v0.8.0**) to VistA's Kernel device handler. Branch
`m2-vslio` off v-stdlib `main`. Second `VSL*` module (after `VSLCFG`).

## Re-pin (boundary ①) — first real fetch-at-tag
`make pin` after hand-setting `dist/msl-seam-pin.json` `msl_ref` v0.7.0→**v0.8.0**:
syncs the `seams` block from the sibling m-stdlib `git show v0.8.0:dist/
seam-snapshot.json` → now carries **STDENV + STDNET** (6 verbs). `check-msl-pin`
green (2 seams match MSL@v0.8.0). This is the first real run of T0b.4's
fetch-the-contract-at-the-tag path (it had only ever SKIP'd before).

## The adapter — outbound CLIENT only (key design finding)
**VistA has NO Supported Kernel listen/accept (server) API** (corpus-confirmed:
Kernel Device Handler DG lists only the client-side `CALL^%ZISTCP`; inbound is the
listener-process/JOB pattern — `ZISTCP^XWBTCPM1` etc). So VSLIO binds the **client
subset** of STDNET's signature; the SERVER/listener side stays in portable STDNET
(never duplicated up — waterline §9 no-duplication).

API: `$$connect^VSLIO(host,port,timeout)`→handle · `$$read(id,max,to,.buf)` ·
`$$write(id,buf)` · `$$close(id)` · `$$lastError()`. The handle **is the opened
device** (`IO`, e.g. `SCK$57028`).

## CALL^%ZISTCP — the real API (the corpus doc was WRONG)
The vdocs gold doc describes an **input-variable** convention (`IPADDRESS`/`SOCKET`/
`TIMEOUT`, bare `D CALL^%ZISTCP`) — that is **wrong vs the live routine**. The
actual entry is **argument-passed**: `CALL(IP,SOCK,TO)`, i.e.
**`D CALL^%ZISTCP(host,port,timeout)`** (read the source on vehu with
`$T(CALL+i^%ZISTCP)`). `POP`=0 success / positive fail; on success **`IO`** holds
the socket device. The GT.M arm (`CGTM`) does `OPEN NIO:(CONNECT=IP_":"_SOCK_
":TCP":ATTACH="client"):TO:"SOCKET"` and **leaves the socket device CURRENT** — so
`connect` must `use pio` (restore `$IO`) BEFORE returning or its caller writes into
the socket. `CLOSE^%ZISTCP` reads `IO` (set `IO`=handle first) and calls
`HOME^%ZIS` → also save/restore `$IO` around it. `@icr 2118 @call CALL^%ZISTCP` +
`@call CLOSE^%ZISTCP`, `@source XU/krn_8_0_dg_device_handler_ug#callzistcp-…` /
`#closezistcp-…` (check-icr + check-citations green). Engine-portable: `^%ZISTCP`
branches by OS internally (CGTM/CONT), so VSLIO needs no `$ZVERSION` arm.

## Acceptance (tiered, both engines over the driver)
- **vehu (YDB) 10/10:** tier-1 `CALL^%ZISTCP`→POP=0 + tier-2 byte echo (loopback:
raw **STDNET listener** for the server side — STDNET works on the GT.M VistA
engine — and VSLIO `CALL^%ZISTCP` as the client; ping out, pong back) + the
connect-failure + TLS-gap tests.
- **foia-t12 (IRIS) 6/6:** the connect-failure test (CALL^%ZISTCP `CONT` path →
POP positive to a closed port → handle 0) proves the binding is wired on IRIS;
TLS-gap tests pass; the **loopback soft-skips** (STDNET listener is YDB-only —
STDNET's IRIS leg is the owed m-stdlib follow-up, so the IRIS POP=0+echo is
blocked on it, not on VSLIO).
- Test staging: `m test --engine … --docker … [--namespace VISTA] --routines src
--routines <m-stdlib>/src tests/VSLIOTST.m` (the Makefile `test` target now adds
`--routines $(SRC)` so VSL* suites resolve, like the VSLCFGTST canonical cmd).

## TLS gap — loud (mirrors STDNET, per the standing directive)
`$$tlsAvailable^VSLIO()`=0; `$$connectTls^VSLIO` **raises `,U-VSLIO-NOTLS,`** (via
`raiseNoTls`, stashing `^TMP($job,"vslio","err")`) — never silent plaintext;
`$$tlsHelp`/`$$lastError` carry remediation (cert + `XU*8.0*787` / IRIS
`Security.SSLConfigs`; wire over the Kernel `INIT-XUTLS` #7616 + `ISTLSSERVERCONF-
XUSUDO` #7617). **Gotcha:** the remediation string must NOT contain literal
`^XUTLS`/`^XUSUDO` — `check-icr` scans code strings for `^XU*` and flags them as
undeclared L4 calls (write `INIT-XUTLS`/`ISTLSSERVERCONF-XUSUDO` with hyphens).
`m-lint disable-file=M-MOD-024` (device-handler input vars read as locals, like
STDNET). Tier-3 (real TLS echo) stays infra-blocked — the gating cleanup STDNET's
discoveries row already tracks.

## Gates (all green)
`make check-fast`: fmt/lint/`m arch check .` (layer v) + check-seams (0 — VSLIO is
the consumer, no @seam) + **check-icr (4: VSLCFG #2263 ×2 + VSLIO #2118 ×2)** +
**check-citations (4 vs gold corpus)** + check-namespaces (2 routines VSL) +
**check-msl-pin (v0.8.0)** + check-engine-access + check-kids. No KIDS/VSLBLD work
(that's M5); VSLIO is NOT in the VSL KIDS base yet.

**Next: M3** (VSLFS — the FileMan storage seam, §12.2). Owed for full M2: STDNET's
IRIS leg (unblocks the IRIS loopback) + tier-3 TLS (the gating infra cleanup).
Loading
Loading