Skip to content

Commit fd869d8

Browse files
committed
ci: stop executing an unpinned latest OMP install in the advisory step
The advisory job installed @oh-my-pi/pi-coding-agent@latest and ran the bridge suite against it on every CI run -- mutable, unpinned third-party code executing unconditionally. Replace the install-and- run with a download-only check: fetch the package with install scripts disabled, then statically compare index.ts's imported path-utils symbols against that file's declared exports as plain text. The downloaded package is never imported or executed, but the same upstream symbol move (isReadableUrlPath, pi-coding-agent -> pi-tui) that motivated this step still surfaces.
1 parent 08a2d42 commit fd869d8

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,40 @@ jobs:
108108
- name: Run OMP bridge tests
109109
run: GRAPHIFY_TEST_CLI=$PWD/.venv/bin/graphify bun test tests/omp.test.ts
110110

111-
- name: Run OMP bridge tests against the latest OMP (advisory)
112-
# bun install --frozen-lockfile above only proves the bridge works
113-
# against the exact pinned version. Upstream OMP has moved exported
114-
# symbols between minor releases before (isReadableUrlPath moved from
111+
- name: Check for upstream symbol moves (advisory, no execution)
112+
# The frozen run above only proves the bridge works against the
113+
# exact pinned version. Upstream OMP has moved exported symbols
114+
# between minor releases before (isReadableUrlPath moved from
115115
# pi-coding-agent to pi-tui) without the frozen lockfile ever seeing
116-
# it; index.ts now vendors that predicate locally instead of tracking
117-
# whichever package currently exports it. Install whatever OMP
118-
# publishes today and re-run the suite so a future move to
119-
# @oh-my-pi/pi-coding-agent's exports still surfaces here.
116+
# it; index.ts now vendors that predicate locally instead of
117+
# tracking whichever package currently exports it. This step used
118+
# to install @latest AND execute the whole suite against it --
119+
# unpinned, mutable third-party code running on every CI invocation.
120+
# It now only downloads the published package (--ignore-scripts:
121+
# no install hooks run) and statically compares index.ts's imported
122+
# path-utils symbols against that file's declared exports as plain
123+
# text -- the downloaded code is never imported or executed, but a
124+
# future symbol move still surfaces here.
120125
# continue-on-error: an unrelated upstream release must not block a
121126
# merge; the frozen run above stays the blocking gate.
122127
continue-on-error: true
123128
run: |
124-
bun add --cwd graphify/omp -d @oh-my-pi/pi-coding-agent@latest
125-
GRAPHIFY_TEST_CLI=$PWD/.venv/bin/graphify bun test tests/omp.test.ts
129+
bun add --cwd graphify/omp -d @oh-my-pi/pi-coding-agent@latest --ignore-scripts
130+
bun -e '
131+
const fs = require("node:fs");
132+
const index = fs.readFileSync("graphify/omp/index.ts", "utf8");
133+
const block = index.match(/import\s*{([^}]+)}\s*from\s*"@oh-my-pi\/pi-coding-agent\/tools\/path-utils"/);
134+
if (!block) throw new Error("no path-utils import block found in index.ts");
135+
const imported = block[1].split(",").map((s) => s.trim()).filter(Boolean);
136+
const source = fs.readFileSync("graphify/omp/node_modules/@oh-my-pi/pi-coding-agent/src/tools/path-utils.ts", "utf8");
137+
const exported = new Set([...source.matchAll(/^export\s+(?:async\s+function|function)\s+(\w+)/gm)].map((m) => m[1]));
138+
const missing = imported.filter((name) => !exported.has(name));
139+
if (missing.length) {
140+
console.error(`@oh-my-pi/pi-coding-agent@latest no longer exports: ${missing.join(", ")}`);
141+
process.exit(1);
142+
}
143+
console.log(`ok: every imported symbol is exported by @latest (${imported.join(", ")})`);
144+
'
126145
127146
security-scan:
128147
# The dev deps include bandit and pip-audit. Run them in CI so a new

0 commit comments

Comments
 (0)