Skip to content

Config write redirect - #124

Merged
fredbi merged 3 commits into
go-openapi:masterfrom
fredbi:config-write-redirect
Aug 17, 2026
Merged

Config write redirect#124
fredbi merged 3 commits into
go-openapi:masterfrom
fredbi:config-write-redirect

Conversation

@fredbi

@fredbi fredbi commented Aug 17, 2026

Copy link
Copy Markdown
Member

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

fredbi and others added 3 commits August 17, 2026 22:43
Names the boundary explicitly, so that what is refused and what is fixed read as
one posture rather than as case-by-case judgement. The command line, the terminal
and the process environment are the user's own; what originates in a scanned
repository is not, and neither are assets fetched to build the documentation site.

Stated per component, because the consequence differs by artifact: what the
library emits carries text the scanned repository wrote, so a caller rendering or
serving it passes on untrusted content; the TUI must not let that content reach
the terminal as instructions; the CLI and the TUI must not let it choose where
they read or write; and the playground analyses in the visitor's browser, which
is a property of the playground rather than of genspec-wasi, whose standalone
WASI runs read and write whatever the host mounts.

The supported version said 0.33.x, three minors behind and the first line a
reporter reads.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
A configuration file is found by searching upwards, so running a command inside a
repository reads THAT repository's file. Most of what a file sets shapes the
document, which is what one is for. An option that decides a PATH is different:
it lets the tree being scanned choose where the command reads or writes, and the
tree is somebody else's.

genspec's document.output was the sharp case -- clone a hostile repo, run it, and
the repo picks where the document lands and largely what is in it, since
descriptions come from its own doc comments. scan.workdir is the same shape
pointed the other way, at what gets read, and the TUI's profile.profile-dir picks
a directory to create files in.

All three leave the schema. The rule is the option's rather than the file's
provenance: nothing to reason about at a call site, no mechanism to explain, and
a scanned tree can no more name a path than it can name the command line. Each
command's coverage guard now asserts both directions, so an excused option that
crept back into a section fails rather than passing quietly.

The cost is real and worth stating: a project's .codescan.yaml can no longer say
which directory to scan, which six tests treated as a feature. -workdir moves to
the command line, as -output already had to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
The reference showed WorkDir addressed in the scan section, and four working
examples across the site and the command READMEs opened with workdir or output in
the file -- the shape that is now an error.

The reference row reads as a dash, like the positional patterns and the callbacks
already did, and the column gains a legend saying what a dash covers: either the
option is nothing a file can carry, or it names a path.

Setting options gains the rule itself, since that page is where somebody goes to
learn what a file is for. Its note about the search starting from the current
directory rather than from -workdir kept the old reasoning -- a file free to set
the very directory it was found through -- and now gives that as one of the
reasons the option is not settable at all.

Each example loses the path keys and shows them typed beside it, so the pattern
being taught is the one that works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi merged commit 87a897c into go-openapi:master Aug 17, 2026
32 checks passed
@fredbi
fredbi deleted the config-write-redirect branch August 17, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant