Repository navigation
fix(manager): type unread files, and give each parser one state model - #206
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 3ed108a | Commit Preview URL Branch Preview URL |
Nov 09 2026, 01:05 AM |
sweepies
added a commit
that referenced
this pull request
Nov 8, 2026
…d settings Review findings on #206: - Nested `${` templates recursed without bound: a short build script could overflow the stack and abort the process. Templates now nest at most 32 deep; deeper text does not lex and its file is skipped with a warning. - An unread `.npmrc` parsed as empty and an unread `.yarnrc.yml` as a bare YAML string, so their packages fell back to npmjs. A stand-in now marks its directory unread, and any unread npm settings file on a package's path fails its lookup, even when a readable file further up names the scope. - A slashy regex after `return`, `println` and similar keywords is read as a string, so such valid Groovy is no longer skipped. - Build logic whose braces never close does not lex, as documented. - Dockerfile continuations join without a space, as Docker does; a byte-order mark, the escape directive and heredoc bodies are handled.
sweepies
added a commit
that referenced
this pull request
Nov 8, 2026
…ontexts Second-pass review findings on #206: - An unread Gemfile.lock read as an empty lock, so a gem the Gemfile put on rubygems.org was looked up there even when the real lock recorded a private remote. An unread lock now makes the lookups it could steer fail, as Composer's does. - An unread aube-lock.yaml read as an empty lock; it now fails like npm's locks. - A slashy regex after `else`, `do`, a closing brace or a binary operator is read as a string, not division.
sweepies
added a commit
that referenced
this pull request
Nov 9, 2026
Two review rounds on #206 found the same class of leak: a reader parsed the stand-in text of a file the Count did not read as an empty file, and a package fell back to a public registry (an unread .npmrc, then an unread Gemfile.lock). Every reader had to remember to check a magic string. Now it cannot forget: - Files maps paths to Text, Read(String) or Unread(Unread), and Text::read is the only way to a file's text, so every reader decides what an unread file means. The stand-in strings and Unread::of are gone. - Manifests that were not read are skipped with a warning before any extractor sees them; the public-only verdict is false for any unread file a verdict covers; settings and lock readers fail the lookups an unread file could steer, as each already did by hand. - An unread Gradle script or gradle.properties stops variable resolution trusting any definition, since it may redefine any name. - The engine records unread files as Text::Unread; the update crate's tool trees, read from disk, go through patchula_manager::all_read.
sweepies
added a commit
that referenced
this pull request
Nov 9, 2026
…d settings Review findings on #206: - Nested `${` templates recursed without bound: a short build script could overflow the stack and abort the process. Templates now nest at most 32 deep; deeper text does not lex and its file is skipped with a warning. - An unread `.npmrc` parsed as empty and an unread `.yarnrc.yml` as a bare YAML string, so their packages fell back to npmjs. A stand-in now marks its directory unread, and any unread npm settings file on a package's path fails its lookup, even when a readable file further up names the scope. - A slashy regex after `return`, `println` and similar keywords is read as a string, so such valid Groovy is no longer skipped. - Build logic whose braces never close does not lex, as documented. - Dockerfile continuations join without a space, as Docker does; a byte-order mark, the escape directive and heredoc bodies are handled.
sweepies
added a commit
that referenced
this pull request
Nov 9, 2026
…ontexts Second-pass review findings on #206: - An unread Gemfile.lock read as an empty lock, so a gem the Gemfile put on rubygems.org was looked up there even when the real lock recorded a private remote. An unread lock now makes the lookups it could steer fail, as Composer's does. - An unread aube-lock.yaml read as an empty lock; it now fails like npm's locks. - A slashy regex after `else`, `do`, a closing brace or a binary operator is read as a string, not division.
sweepies
force-pushed
the
fix/manager-state
branch
from
November 9, 2026 01:00
302e733 to
87035c0
Compare
sweepies
added a commit
that referenced
this pull request
Nov 9, 2026
Two review rounds on #206 found the same class of leak: a reader parsed the stand-in text of a file the Count did not read as an empty file, and a package fell back to a public registry (an unread .npmrc, then an unread Gemfile.lock). Every reader had to remember to check a magic string. Now it cannot forget: - Files maps paths to Text, Read(String) or Unread(Unread), and Text::read is the only way to a file's text, so every reader decides what an unread file means. The stand-in strings and Unread::of are gone. - Manifests that were not read are skipped with a warning before any extractor sees them; the public-only verdict is false for any unread file a verdict covers; settings and lock readers fail the lookups an unread file could steer, as each already did by hand. - An unread Gradle script or gradle.properties stops variable resolution trusting any definition, since it may redefine any name. - The engine records unread files as Text::Unread; the update crate's tool trees, read from disk, go through patchula_manager::all_read.
- A file the Count did not read was one of two magic strings, and the public-only verdict compared only one of them: a .npmrc, yarn.lock or Gemfile.lock that the include chain reached too late counted as public. Unread is now an enum, and Unread::of is the only way to recognise one, so every reader sees every reason. The verdict fails closed for both. - YAML locations track each mapping's slot explicitly. A complex or alias key used to shift every later key onto the wrong value; now it and its value go unnamed and the keys after it keep their own. - Gradle had two comment maskers that disagreed about `//` inside a template. The lexer now produces both views from one pass, and a script it cannot read is skipped with a warning instead of read in part. - Dockerfile continuations skip empty lines, as Docker does. - An unclosed go.mod `require (` block fails like `replace (` and `use (`. - CredentialCheck names the scan, skip and undecided outcomes. - Terraform's required_version no longer edits whatever was pushed last.
…d settings Review findings on #206: - Nested `${` templates recursed without bound: a short build script could overflow the stack and abort the process. Templates now nest at most 32 deep; deeper text does not lex and its file is skipped with a warning. - An unread `.npmrc` parsed as empty and an unread `.yarnrc.yml` as a bare YAML string, so their packages fell back to npmjs. A stand-in now marks its directory unread, and any unread npm settings file on a package's path fails its lookup, even when a readable file further up names the scope. - A slashy regex after `return`, `println` and similar keywords is read as a string, so such valid Groovy is no longer skipped. - Build logic whose braces never close does not lex, as documented. - Dockerfile continuations join without a space, as Docker does; a byte-order mark, the escape directive and heredoc bodies are handled.
…ontexts Second-pass review findings on #206: - An unread Gemfile.lock read as an empty lock, so a gem the Gemfile put on rubygems.org was looked up there even when the real lock recorded a private remote. An unread lock now makes the lookups it could steer fail, as Composer's does. - An unread aube-lock.yaml read as an empty lock; it now fails like npm's locks. - A slashy regex after `else`, `do`, a closing brace or a binary operator is read as a string, not division.
Two review rounds on #206 found the same class of leak: a reader parsed the stand-in text of a file the Count did not read as an empty file, and a package fell back to a public registry (an unread .npmrc, then an unread Gemfile.lock). Every reader had to remember to check a magic string. Now it cannot forget: - Files maps paths to Text, Read(String) or Unread(Unread), and Text::read is the only way to a file's text, so every reader decides what an unread file means. The stand-in strings and Unread::of are gone. - Manifests that were not read are skipped with a warning before any extractor sees them; the public-only verdict is false for any unread file a verdict covers; settings and lock readers fail the lookups an unread file could steer, as each already did by hand. - An unread Gradle script or gradle.properties stops variable resolution trusting any definition, since it may redefine any name. - The engine records unread files as Text::Unread; the update crate's tool trees, read from disk, go through patchula_manager::all_read.
task_files dropped an unread mise config as if it included nothing, so a configuration it pulled in from another folder through `..` lost its only link to it and looked its tools up on the public backends. An unread mise config may include anything, so every mise tool now fails its lookup while one exists.
sweepies
force-pushed
the
fix/manager-state
branch
from
November 9, 2026 01:05
87035c0 to
3ed108a
Compare
Merged
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.
Third PR that replaces implicit state machines with explicit ones (after #204 and #205).
Changes
public::verdictcompared against onlyUNREADABLE_SETTINGS. A.npmrc,yarn.lock,Gemfile.lockor.slnthat a Gradleapply from:chain reached pastMORE_ROUNDStherefore gotUNREADABLE_DEEPtext and counted as public-only.Unread(Failed,TooDeep) now replaces both constants, andUnread::ofis the only classifier, so no reader can recognise one reason and miss the other. Gradle and Maven shareUnread::reasonfor the warning text.Slot(Key,Value(Option<key>)). A complex key (? [a, b]) or an alias key used to consume no key slot, which shifted every later key onto the wrong value. Now that key and its value have no pointer, and the keys after it keep their own.gradle_vars::maskand theLexerdisagreed about//inside a${…}template. The lexer now fills two buffers in one pass: code, with string text blanked, and comments-only, with strings kept. Both views therefore agree, and lexer decisions such as slashy-string detection read the same buffer in both modes. A script the lexer can't read is skipped with askipped:warning rather than read in part. The corpus snapshot is unchanged.FROM \followed by a blank line still finds its image.require (block fails, as unclosedreplace (anduse (blocks already did.CredentialCheck(Scan,Skip,Undecided) replacesOption<bool>.addreturns the dependency it pushed, sorequired_versioncan't modify whatever was pushed last.Tests
New tests cover both unread reasons for line-based files, complex and alias YAML keys,
//inside a Gradle template plus an unterminated script, and a Dockerfile continuation with an empty line and a comment line. Thepatchula-managerandpatchula-enginesuites pass, and Clippy is clean on manager, engine and update.