Post by genxia about Nosana token ($NOS)

  • User Avatar
    @genxiaCompute•2

    $NOS - Empty-string and newline values pass the preflight validator

    I ran @nosana/types 2.14.2 validateJobDefinition() locally (no wallet, no network) against a minimal job ({version:'0.1', type:'container'}). Several inputs return success:true even though the resulting job cannot run:

    image: "" and image: " " (whitespace only) - accepted. validateImage only checks typeof input === 'string', so an empty image reference passes.

    id: "" - accepted, although the rule text says ids must not contain spaces or full stops. An empty id cannot be referenced from results or execution.

    id with a newline - accepted, while id: "a b" (space) is correctly rejected. Whitespace handling is inconsistent.

    create-volume with name: "" - accepted. cmd: [] and cmd: [""] - accepted. ops: [] - accepted, so a job with zero operations validates.

    For contrast it does correctly reject: missing image, missing id, whitespace-only id, duplicate ids, and ops: null.

    Why it matters: preflight is the last local check before a job is published on-chain. Every case above passes preflight, then fails at runtime or produces an operation that can never be referenced - costing the publisher a slot and the operator a failed run. Trimming and emptiness checks, plus treating newline, tab and carriage-return like the space already rejected in ids, would close all of these without changing the schema.
    $NOS is a gem!