Cotal TypeScript packages
    Preparing search index...

    Variable provenanceConst

    provenance: {
        read(what: string, source: string): void;
        removed(what: string, dest: string): void;
        wrote(what: string, dest: string): void;
    } = ...

    One consistent voice for CLI provenance, on stderr: which on-disk source a command RESOLVED its configuration from, and what it WROTE where. Commands must never silently pick up state from a directory or silently drop files — every read of config (persona file, mesh entry, config.json layer) and every write (creds, seeded files) gets one dim arrow line. stderr so it never pollutes machine-readable stdout; plain text so this layer needs no color dep.

    One call is one line whatever its arguments hold. A path can carry a newline, and written raw it would let one call announce a second act the command never made, or a carriage return overwrite the act it did make. So every control character and Unicode line separator in the line is shown as a \uXXXX escape instead. On a terminal a long line wraps at spaces like the CLI's other notices, each continuation line under the text after the arrow. The source, such as a path, is one word however many spaces it holds: when it does not fit after the label it keeps a line of its own, wider than the line if it must be, and is never split. To a pipe or a file it stays one line.

    Failure policy: a line reports an act that already happened, so a fault on stderr must neither fail that act nor drop the line unsaid. When the stderr write throws or fails (EPIPE, ENOSPC, EIO), at once or after waiting in a full pipe, the line is written to stdout instead with the error named. If stdout fails too, no channel is left to carry the line, and a run that would exit 0 exits 1, so the loss is never silent. The deferred error event of a stream that failed a line is absorbed, so it cannot crash the command after its write and the command finishes its work, unless the program's own listener ends it, as the CLI's does on any stdout error. A line still waiting in a full pipe when the process exits, as when the CLI exits at once on a closed stdout, is lost the same way and counts the same. Node does not say whose bytes a stream still holds, so a line that had to wait and got through just before the exit also counts while later output still waits behind it: the check cannot tell it from a line still waiting, and counts both. The other bound: a stderr closed before the process starts is reopened by Node on /dev/null, which looks the same as an operator's 2>/dev/null, so the line is discarded where the operator sent it.

    Type Declaration

    • read: function
      • → using <what>: <source> — the source that WON resolution (say which layer/path).

        Parameters

        • what: string
        • source: string

        Returns void

    • removed: function
      • → removed <what>: <dest>: announce every file or directory the command DELETED. A silent delete is worse than a silent write, because the write at least leaves the thing it made while the delete leaves nothing to notice. Destructive steps get the one line the additive ones get.

        Parameters

        • what: string
        • dest: string

        Returns void

    • wrote: function
      • → wrote <what>: <dest> — announce every file the command created or replaced.

        Parameters

        • what: string
        • dest: string

        Returns void