Repository navigation
feat(tla-state-check): pin everystate by sha512, not just version - #54
Merged
Merged
Conversation
Fetch the 0.4.3 tarball with npm pack, check its sha512 against the hash recorded in the skill, and run the checker from that local tarball. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Guillaume Lebedel <[email protected]>
…ting npm pack follows the dist.tarball the registry metadata names and can run a prepare script from a git source before any check. Download the fixed registry URL instead, hash in memory, and write the tarball only on a match. The command has no '!', so cmd.exe delayed expansion cannot flip the comparison. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Guillaume Lebedel <[email protected]>
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 5/5
- In
everystate.md, a failed download can be reported as a hash mismatch instead of the HTTP error. Checkr.okbefore hashing so the status is clear.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="plugins/engineering/tla-state-check/skills/tla-state-check/references/everystate.md">
<violation number="1" location="plugins/engineering/tla-state-check/skills/tla-state-check/references/everystate.md:15">
P3: The download step doesn't check the HTTP status, so a 404 or 5xx body gets hashed and reported as a hash mismatch. Check `r.ok` before hashing so the error names the HTTP status instead.</violation>
</file>
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Turn on auto-fix | Re-trigger cubic
…atch Addresses cubic review on #54: check r.ok before hashing and catch fetch failures, so a 404 or offline run says why and still writes nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Guillaume Lebedel <[email protected]>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Confidence score: 4/5
- In
everystate.md, this catch also treatswriteFileSyncfailures as download failures, so a disk error can leave a truncated tarball while reporting that nothing was written. Catch download errors separately or report write failures accurately.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="plugins/engineering/tla-state-check/skills/tla-state-check/references/everystate.md">
<violation number="1" location="plugins/engineering/tla-state-check/skills/tla-state-check/references/everystate.md:15">
P3: This catch also handles `writeFileSync` failures, so a disk error can leave the tarball truncated while the command reports “nothing written” and calls it a download failure. Catch download errors separately or report save failures without claiming nothing was written.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Addresses cubic review on #54: a failed write no longer leaves a partial everystate-0.4.3.tgz, and the error says download or save failed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: Guillaume Lebedel <[email protected]>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: This PR does not meet the repository auto-approval settings.
Turn on auto-fix | Re-trigger cubic
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.
Answers Guillaume's question on #52 ("should that not be sha pinned?"): yes. The skill pinned
[email protected]by version only, so it trusted the registry to serve the same bytes. npm's own integrity check compares against a hash from that same registry, so it does not help if the registry entry changes.Requested by [email protected] in the Slack thread (C0C90EFJ0DQ, 1796040539.253869).
What changed
references/everystate.md: the run is now two commands. Anode -eone-liner downloadshttps://registry.npmjs.org/everystate/-/everystate-0.4.3.tgz, hashes it in memory and, only when its sha512 matches the hash written in the skill, writes it toeverystate-0.4.3.tgz.partand renames it toeverystate-0.4.3.tgz. Thennpm exec --package=./everystate-0.4.3.tgzruns that file. On any failure it prints why, exits 1 and leaves no tarball under the final name, and the skill tells the agent to stop and report the message.SKILL.mdstep 2 and the README describe the new flow. The requirement is now Node.js 18 or later (forfetch).plugin.jsonand themarketplace.jsonentry; Codex manifest regenerated.Why not
npm pack+ a separate hash check (my first commit, 0ef9073)A Codex security pass found two holes in it, both closed in ab476f3:
npm packfollows thedist.tarballthe registry metadata names. If that points at a git source, npm runs itspreparescript before any hash check. A fixed URL with the check in memory means nothing from the package runs or lands on disk before the check.h!==.... Undercmd.exewith delayed expansion,!is eaten and the comparison flips. The new command has no!.cubic then found two P3s (5ce5b09, 51650b2): an HTTP error was reported as a hash mismatch, and a failed write could leave a partial tarball. Both fixed and resolved.
Verification (dogfood on 51650b2, Node 22, live npm registry)
x <= 2)x <= 1)Invariant Inv is violatedHash mismatch, nothing written, no fileDownload or save failed: HTTP 404 from <url>, no fileDownload or save failed: fetch failed, no fileDownload or save failed: EACCES ..., no file!in the commandGates (head 51650b2)
generate_codex_marketplace.py --checkvalidate_codex_plugins.pycheck_plugin_versions.py --base origin/mainpython3 -m unittest discover -s testsclaude plugin validate --strict ./code-review(low)/forge:forge,/eng-reviewAfter merge
Check that the marketplace lists tla-state-check 1.1.0, and run the skill's download line against
mainfrom a clean directory.🤖 Generated with Claude Code