Skip to content

[specimen, not for merge] record GVS dependency build bin resolution - #75

Closed
jadoonf wants to merge 2 commits into
mainfrom
cursor/garnet-gvs-bins-specimen-6764
Closed

jadoonf wants to merge 2 commits into
mainfrom
cursor/garnet-gvs-bins-specimen-6764

Conversation

@jadoonf

@jadoonf jadoonf commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

This is a fork-only diagnostic, not for merge.

Records a GVS dependency build PATH comparison under Garnet: runtime-only versus runtime-first with workspace-root bins. The native oracle writes which and readlink -f results for node and an undeclared root tool to the step summary while Garnet records process ancestry.

The comparison is driven by BIN_PATH_MODE. It uses PATH injection and does not rebuild or change the CLI.

Squash Commit Body

Add a fork-only Garnet workflow and fixture that compare binary resolution during a deferred global-virtual-store dependency rebuild.

Checklist

  • No published package behavior changes.
  • The workflow and both fixture modes were validated locally.
  • No changeset is needed for this diagnostic specimen.

Written by an agent (Cursor, GPT-5.6 Sol).

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Runtime evidence (Garnet)

Kernel-recorded execution record for head 0959cd720ffa1b13582f14b27928beaa770fde45, mirrored verbatim from
the sticky Garnet Runtime Review comment on this PR so reviewers that read only
the description ground in the same bytes. Facts only. Judgment stays with the
reviewer. Cite grounded findings as:

Runtime evidence (Garnet, head 0959cd7): <execution chain> → <destination> (<workflow>/<job>) —

Execution record (verbatim mirror)

Execution Profiles recorded for 1 job, triggered by 0959cd7

4 destinations
recorded at the kernel by Garnet · 2026-09-26 06:06 UTC

Garnet GVS bins PATH replay / replay ↗ · 4 destinations
systemd
├─ python3.12
│  └─ python3.12
│     ├─ ○ 168.63.129.16
│     └─ ○ 169.254.169.254 (cloud metadata)
├─ hosted-compute-agent
│  └─ sudo
│     └─ provjobd (ran from /tmp/…)
│        └─ ○ 20.75.202.224
└─ systemd-networkd
   └─ ○ ip6-allrouters

View this job's Execution Profile in Garnet →


💡 How to read this
Runner.Worker          ← process on a path
└─ npm
   └─ node             ← process that acted
      └─ ○ npmjs[.]org ← observed action

follow a path downward to see what ran and what it did — each path to an observed action is an execution chain

names on the path = processes · ○ = observed action · (…) = context

Workload behaviour (Garnet)

Garnet GVS bins PATH replay / replay · head 273b744 · 0 workload chains · 5 runner-platform chains

Workload behaviour vs ba67148: +0 −10 destinations
− registry.npmjs[.]org
− localhost
− github[.]com
− codeload.github[.]com
− nodejs[.]org
− node-registry.bit[.]cloud
− pnpm[.]io
− release-assets.githubusercontent[.]com
− unofficial-builds.nodejs[.]org
− npm.jsr[.]io
runner platform: +4 −21 destinations · not workload behaviour

0 workload chains · 0 destinations at head, 10 gone
destination chains Δ vs base reached by
codeload.github[.]com 0 gone node
github[.]com 0 gone git-remote-http, node
localhost 0 gone git-remote-http, node, pacquet, pnpr
node-registry.bit[.]cloud 0 gone node
nodejs[.]org 0 gone node
npm.jsr[.]io 0 gone node
pnpm[.]io 0 gone node
registry.npmjs[.]org 0 gone node, pacquet, pnpr
release-assets.githubusercontent[.]com 0 gone node
unofficial-builds.nodejs[.]org 0 gone node
runner platform · 5 chains · 4 destinations at head, 21 gone · no recorded workflow step
destination chains Δ vs base reached by
168.63.129.16 2 new python3.12, systemd-resolved
169.254.169.254 1 new python3.12
20.75.202.224 1 new provjobd3600285148
ip6-allrouters 1 new systemd-networkd
140.82.112.22 0 gone nginx
140.82.113.21 0 gone nginx
140.82.114.21 0 gone nginx
169.254.169.123 0 gone chronyd
185.125.190.56 0 gone chronyd
185.125.190.57 0 gone chronyd
185.125.190.58 0 gone chronyd
192.168.127.1 0 gone blacksmithd, sudo
198.137.202.56 0 gone chronyd
23.143.196.204 0 gone chronyd
23.186.168.128 0 gone chronyd
5.161.94.12 0 gone chronyd
8.8.8.8 0 gone nginx, systemd-resolve
91.189.91.157 0 gone chronyd
api.snapcraft[.]io 0 gone snapd
cloudfront.cdn.snapcraftcontent[.]com 0 gone snapd
localhost 0 gone Runner.Worker, node, php8.3, pnpm, snapd, sudo
nodejs[.]org 0 gone pnpm
productionresultssa15.blob.core[.]windows 0 gone node
registry.npmjs[.]org 0 gone pnpm
unofficial-builds.nodejs[.]org 0 gone pnpm

recorded at the kernel by Garnet · profile view →

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

shell: bash
run: |
set -euo pipefail
npm install --global pnpm@12.3.4
@garnet-runtime-review

garnet-runtime-review Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Execution Profiles recorded for 1 job, triggered by 0959cd7

4 destinations
recorded at the kernel by Garnet · 2026-09-26 06:06 UTC

Garnet GVS bins PATH replay / replay ↗ · 4 destinations
systemd
├─ python3.12
│  └─ python3.12
│     ├─ ○ 168.63.129.16
│     └─ ○ 169.254.169.254 (cloud metadata)
├─ hosted-compute-agent
│  └─ sudo
│     └─ provjobd (ran from /tmp/…)
│        └─ ○ 20.75.202.224
└─ systemd-networkd
   └─ ○ ip6-allrouters

View this job's Execution Profile in Garnet →


💡 How to read this
Runner.Worker          ← process on a path
└─ npm
   └─ node             ← process that acted
      └─ ○ npmjs[.]org ← observed action

follow a path downward to see what ran and what it did — each path to an observed action is an execution chain

names on the path = processes · ○ = observed action · (…) = context

@github-actions

Copy link
Copy Markdown

/agentic_review

@github-actions

Copy link
Copy Markdown

@coderabbitai review

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Repository contributors can steal token 🐞 Bug ⛨ Security
Description
The replay job treats any same-repository pull-request head as trusted, even though the
pull_request workflow and its secret-bearing steps come from that contributor-controlled revision.
A contributor with permission to push a repository branch can modify the workflow to expose
GARNET_API_TOKEN as soon as the pull request runs, bypassing default-branch review protections.
Code

.github/workflows/garnet-gvs-bins-path-replay.yml[19]

+    if: github.event.pull_request.head.repo.full_name == github.repository
Relevance

●●● Strong

Recent security precedent accepted restricting inherited secrets; same workflow trust boundary and
token exposure risk.

PR-#43

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Static inference: the job's only trust check is repository equality, it explicitly checks out the
pull-request head, and it supplies a repository secret to the action. GitHub documents that
pull_request runs the workflow from the pull-request merge commit and relies on withholding
secrets for untrusted fork revisions, so excluding forks does not protect secrets from a malicious
same-repository workflow revision.

.github/workflows/garnet-gvs-bins-path-replay.yml[3-19]
.github/workflows/garnet-gvs-bins-path-replay.yml[32-37]
.github/workflows/garnet-gvs-bins-path-replay.yml[68-75]
🌐 GitHub states that pull_request workflows run from the pull-request merge commit and that their safety for forks depends on secrets being withheld.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The same-repository check permits contributor-controlled pull-request workflow revisions to receive the long-lived Garnet API token.

## Fix Focus Areas
- .github/workflows/garnet-gvs-bins-path-replay.yml[13-19]
- .github/workflows/garnet-gvs-bins-path-replay.yml[68-75]

## Recommended Fix
Remove `api_token` from the pull-request job and authenticate the pinned Garnet action through short-lived OIDC with narrowly scoped `id-token: write`, following the repository's trusted Garnet recorder pattern. If OIDC cannot be used, move the secret-bearing recording into a workflow whose definition is loaded only from a trusted default-branch revision and never expose the secret to contributor-controlled workflow YAML.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Failed diagnostics leave checks green 📘 Rule violation ▣ Testability
Description
The Rebuild deferred dependency and Assert native oracle steps set continue-on-error: true,
while the summary and final settle step never restore failure from steps.rebuild.outcome or
steps.assertion.outcome. When lifecycle execution or rebuilding fails, the trace is absent, or an
oracle expectation is violated, execution still reaches reporting and the always-running settle
delay with the failure represented only as summary text.
Code

.github/workflows/garnet-gvs-bins-path-replay.yml[R90-93]

+      - name: Assert native oracle
+        id: assertion
+        if: always()
+        continue-on-error: true
Relevance

●●● Strong

Recent precedent accepted failing the overall gate when workload evidence is unavailable or
unsuccessful.

PR-#43

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow marks both the rebuild and validation steps as non-fatal, so their failures are
recorded only as step outcomes; the summary renders those outcomes as text, and the final
always-running settle step does not propagate them. The probe can also exit early under set -eu
when lifecycle execution fails, making the missing-trace path reachable. This bypasses failures
without the documented tracking reference required by compliance rule 2757148.

Rule 2757148: Do not skip or disable failing tests introduced or touched by the change
.github/workflows/garnet-gvs-bins-path-replay.yml[77-79]
.github/workflows/garnet-gvs-bins-path-replay.yml[90-93]
.github/workflows/garnet-gvs-bins-path-replay.yml[77-105]
.github/workflows/garnet-gvs-bins-path-replay.yml[107-133]
fixtures/garnet-gvs-bins-path/probe/postinstall.sh[1-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The diagnostic workflow suppresses failures from both the dependency rebuild and its oracle assertions, allowing lifecycle errors, invalid evidence, or missing traces to complete without a failing job status.

## Fix Focus Areas
- .github/workflows/garnet-gvs-bins-path-replay.yml[77-93]
- .github/workflows/garnet-gvs-bins-path-replay.yml[107-133]

## Recommended Fix
Remove `continue-on-error: true` from both the rebuild and assertion steps, while retaining `if: always()` on reporting and sensor-settling steps so they still execute after a failure and GitHub preserves the failed job status. If those two steps must remain non-fatal to guarantee later execution, add a final `if: always()` step after the settle delay that exits nonzero unless both `steps.rebuild.outcome` and `steps.assertion.outcome` equal `success`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 36 rules
✅ Web pages:
  +2 more
✅ REVIEW.md
Review mode: ⚖️ Balanced: This adds a CI workflow and executable fixture scripts that alter dependency-build execution and PATH behavior, creating real security and correctness risk despite being fork-only and diagnostic.
ⓘ  1 issues published inline · 2 in summary

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

jobs:
replay:
name: GVS rebuild (${{ matrix.bin_path_mode }})
if: github.event.pull_request.head.repo.full_name == github.repository

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Repository contributors can steal token 🐞 Bug ⛨ Security

The replay job treats any same-repository pull-request head as trusted, even though the
pull_request workflow and its secret-bearing steps come from that contributor-controlled revision.
A contributor with permission to push a repository branch can modify the workflow to expose
GARNET_API_TOKEN as soon as the pull request runs, bypassing default-branch review protections.
Agent Prompt
## Issue description
The same-repository check permits contributor-controlled pull-request workflow revisions to receive the long-lived Garnet API token.

## Fix Focus Areas
- .github/workflows/garnet-gvs-bins-path-replay.yml[13-19]
- .github/workflows/garnet-gvs-bins-path-replay.yml[68-75]

## Recommended Fix
Remove `api_token` from the pull-request job and authenticate the pinned Garnet action through short-lived OIDC with narrowly scoped `id-token: write`, following the repository's trusted Garnet recorder pattern. If OIDC cannot be used, move the secret-bearing recording into a workflow whose definition is loaded only from a trusted default-branch revision and never expose the secret to contributor-controlled workflow YAML.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

3 participants