Files
craft-ai-integrations/tools
Jeremy 191f015fbc fix(ai-comfy-env): accept a pasted pack commit only when the default branch contains it (#188)
* test(ai-native): read access lists in-process in the Windows tests

The owner-only tests read each file's access list back with PowerShell's
Get-Acl. That call failed for every test on the windows-latest CI runner
after #184 merged, while the library code itself was not involved. The
tests now read the owner and list with GetNamedSecurityInfoW, through a
test-only helper in the named unsafe module, and the owner parser no
longer assumes a group section.

* test(ai-native): accept the LA alias for the built-in Administrator

CI runners use the machine's built-in Administrator account (RID 500),
which SDDL writes as LA instead of its full SID. The owner-only tests
compared against the full SID and failed on windows-latest; the files
themselves were correct.

* fix(ai-comfy-env): accept a pasted pack commit only when the repository's default branch contains it

GitHub serves a fork's commits under the original repository's name, so a
node pack address naming a commit id could show and record a fork's code as
the trusted repository's. For a reference written as a commit id, the
resolver now asks GitHub's compare whether the default branch contains it
and refuses anything other than "behind" or "identical". Branch and tag
names are the repository's own and need no extra check. A short commit id
must also match the commit GitHub names.

The compare reply lists changed files and can be far larger than a listing
reply, so it is read as it arrives into a one-field struct (32 MiB read cap,
only the status kept).

* fix(ai-comfy-env): check a pasted commit id of any length against the default branch

GitHub accepts any unambiguous commit prefix, so a six-character id took the
branch-or-tag path and was never compared. A reference now counts as a commit
id when it is hex and begins the commit GitHub resolved it to, whatever its
length; a branch or tag name resolves to a commit that does not begin with it.

* fix(ai-comfy-env): skip the commit check only for the repository's own branch or tag

GitHub reads more than hex ids as a commit, for example `git describe` output
such as `a-1-g3532ebd1`, so guessing from the reference's shape let a fork's
commit through. A pasted reference now skips the compare only when GitHub's
exact ref lookup finds it under `heads/` or `tags/` pointing at the resolved
commit (annotated tags followed). Anything else goes through the compare, and
a lookup that fails for any reason other than 404 stops the install.

A compare reply is now refused when it runs past the size limit, even if the
part read before the limit parses.
2026-11-14 23:32:12 +00:00
..