Browse documentation

Hidden paths cover every line a run prints, and only the command line or the root config turns them on

Date: 2026-12-01 Area: errors, cli Related: #2474, refines ADR 0225, Errors — Hidden paths

Context

ADR 0225 added --hide-paths for diagnostics' locations: stack traces, the uncaught error's --> line, parse warnings and the JSON reports' file names. It kept error messages, a permission error's Suggestion: line and the lines that echo an input (Running script, the test runner's progress lines) as they were, and it let a nested config's "hide-paths": false turn the option off for its files. A run with the option on still printed host directories, which is what the option exists to prevent. On 2026-12-01 Johannes decided both points ("Agree with all"): those lines hide paths too, and only the root config or the command line sets the option.

Decision

  • Every line a run prints that names a host file shows it hidden, in the form ADR 0225 set (relative to the root inside it, <external>/<name> outside it):

    • error messages the engine makes (Cannot find module '<path>', Cannot load bytecode module, The module <path> did not finish evaluating, a data module's parse error, a globals file, manifest or virtual-module config that cannot be read, a snapshot file the test runner refuses or cannot write);
    • an absolute specifier, whether the source wrote it or the host loads a file of its own (a config's globals module, a manifest, --host-environment), in a PermissionDenied message and scope and in Module not found. A relative specifier is the program's own text and stays as written;
    • a permission error's Suggestion: line: the path and the directory a grant would name;
    • the lines that name an input or an output (Running script, the test runner's [n/m] lines, the bundler's Compiling: and Compiled to, Source map written to, Path not found, Error in <file>, an input that cannot be read) and the warnings about a config or a virtual module.

    The root itself, which a suggestion can name as a directory, is shown as ..

  • Where a path is mapped: text the engine makes during a run maps it with ShownHostPath or StackSourceForDisplay under the root the running engine sets for its thread, so an embedder's DiagnosticPathRoot hides it too. The CLI sets the same root for its main thread once the root config is read, and maps the text it prints with TGocciaEngineOptions.ShownPath.

  • The setting holds for the whole run. --hide-paths and the root config's "hide-paths": true turn it on; TGocciaEngineOptions.DiagnosticPathRoot is '' when it is off and every file of the run uses the same root. A nested config's "hide-paths" is ignored, with a warning when its value disagrees with the run's.

  • Unchanged:

    • what the program computes for itself: import.meta.url, import.meta.resolve() and a relative specifier as the source wrote it;
    • the report files an operator asks for (audit log, coverage, profile output), an error in writing one, and the path stored in a .gbc header;
    • errors in the configuration itself, which stop the run: an invalid config value, a missing extends target or import map, and the report of configs whose permissions are not trusted, whose commands are meant to be pasted;
    • commands that are not a script run: the trust commands (--trust and the commands that list or remove trusts) and --install, whose output is the operator's own files;
    • sandbox mode, whose paths are already virtual, and the host paths of its copy inputs and write-back report.

Consequences

  • One host file has one spelling in a run's output with the option on: a message and a suggestion name it as its stack frame does.
  • A suggestion's --allow-read=<external>/... cannot be pasted back as a flag; the option trades that convenience for not showing where the file is. Without --hide-paths the suggestion names the real path.
  • A nested config can no longer turn the option off for a directory of test fixtures; run without --hide-paths to see their full paths.
  • GocciaTestRunner given several files and no --config applies no root config, so a project's "hide-paths": true no longer hides that run's paths as it did when each file's own config set the option. The warning names --config and --hide-paths, either of which turns it on.
  • Output written before the root config is read (an error in reading the root config itself, --config naming a path that is not there) cannot know the setting and keeps the path as given.