Config write redirect - #124
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist