Plan 03-02 Summary: Podman version parser, prerequisite probe, RuntimeConfig validation
Status: done for the unit-verified scope. Live Podman behaviour is not verified (host Podman is 4.9.3; no live call in this plan).
Changes
src/runtime/podman-version.ts: the version parser moved fromtest/integration/podman-version.tswith its bodies unchanged. Header rewritten: the I/O now lives inpodman-probe.ts(D-53). Old file deleted, no re-export (RT-02).src/runtime/podman-probe.ts:probePodman({ runCommand, connectSocket, env, timeoutMs })with injected I/O. Steps run in order and stop at the first failure: (1)podman --versionas argv with no shell and a minimal environment (PATH,HOME,XDG_RUNTIME_DIRonly); (2) version gate through the moved parser; (3) dial of$XDG_RUNTIME_DIR/podman/podman.sock. Reasons are theERROR_CATALOGUEtext plus the specific detail. Raw stdout and raw socket error text are never copied into a reason (RT-02, D-53).src/runtime/config.ts:RuntimeConfigtype andloadRuntimeConfig(input: unknown), hand-written with no schema and no ajv (RT-01, D-52, D-73). Image must be digest-pinned.andaUrlmust behttp:orhttps:with no userinfo.workloadArgvis a non-empty array of non-empty strings and is copied.stateDirandworkspaceRootmust be absolute. Unknown keys are rejected. All violations giveSCHEMA_INVALID.test/runtime/podman-version.test.ts(moved; only the import changed),test/runtime/podman-probe.test.ts,test/runtime/config.test.ts.- Deleted:
test/integration/podman-version.tsandtest/integration/podman-version.test.ts(the move source). Their compiled output underdist/was removed as well.
Tests
node --test dist/test/runtime/podman-version.test.js dist/test/runtime/podman-probe.test.js dist/test/runtime/config.test.js: 40 pass, 0 fail, 0 skipped.- Probe: ENOENT, non-zero exit and timeout give
PODMAN_MISSING; 4.9.3 and unparseable output givePODMAN_UNSUPPORTED_VERSIONnaming the version and the 5.x need; refused, missing and unresponsive sockets, and an unsetXDG_RUNTIME_DIR, givePODMAN_MACHINE_DOWNwith thesystemctl --user start podman.socketfix; 5.x with a socket passes; probing stops at the first failure; the version command receives only the three permitted environment names; raw error text is not echoed. - Config: digest image accepted; tag-only and malformed digests rejected; userinfo (including
:@) rejected; non-http(s) and unparseable URLs rejected; empty or malformed argv rejected; relative paths rejected; missing and unknown keys rejected; argv copied. npx eslinton the six owned files: clean.npx tsc -p tsconfig.json: exit 2. No error comes from an owned file. The errors are intest/integration/podman-gate.test.tsandtest/quality/suite-taxonomy.test.ts(both still import the deleted parser path; owned by plan 03-10) andtest/runtime/libpod-client.test.ts(a sibling plan's in-progress file).
Requirement evidence
- RT-02: parser and probe tests above (unit-verified). The probe is not yet wired into the doctor or the gate; plan 03-10 does that.
- RT-01: config tests above (unit-verified). The hardening verifier is a separate plan.
Deviations and defaults applied
andaUrlis optional inRuntimeConfig. D-69 needs a "not configured" state for the doctor, so an absent key is accepted and the loaded config omits it. When present it is validated.loadRuntimeConfigrejects unknown keys (fail closed). The plan did not specify this.- The deleted
test/integration/podman-version.test.tsis outside this plan'sfiles_modified. It was deleted as the move source, because it would otherwise import a missing module. - Relative paths give
SCHEMA_INVALID(D-73, resolves F-P3-02), notPOLICY_DENIED. - No real
runCommandorconnectSocketimplementation is provided here. Those are injected; the doctor wiring (plan 03-10) supplies them.
Open items for other plans
test/integration/podman-gate.test.ts(plan 03-10) must import from../../src/runtime/podman-version.js.test/quality/suite-taxonomy.test.tsmust import from../../src/runtime/podman-version.js. ItsD45_FILESlist also needs the new runtime test files.