From 7acca8d27428067ad054b32d9b00240e4290ec74 Mon Sep 17 00:00:00 2001 From: "qiansicheng.621" Date: Mon, 19 Oct 2026 04:09:07 +0000 Subject: [PATCH] fix(v0.7.73): preserve inherited PATH for plugin host discovery --- CHANGELOG.md | 5 ++++ bun.lock | 30 +++++++++---------- package.json | 2 +- .../context-workflow/provider.yaml | 2 +- packages/context-cli/package.json | 2 +- .../__tests__/pluginCommandAvailable.test.ts | 19 ++++++++++++ .../productionSubmission.integration.test.ts | 7 +++-- .../src/project/indexerBaseContracts.ts | 2 +- .../src/project/pluginInstallTargets.ts | 3 +- packages/context/package.json | 2 +- packages/core/package.json | 2 +- packages/dev-cli/package.json | 2 +- packages/extract-contract/package.json | 2 +- packages/extract-go/package.json | 2 +- packages/extract-mdx/package.json | 2 +- packages/extract-proto/package.json | 2 +- packages/extract-rush/package.json | 2 +- packages/extract-sql/package.json | 2 +- packages/extract-style/package.json | 2 +- packages/extract-thrift/package.json | 2 +- packages/extract-ts/package.json | 2 +- packages/extract/package.json | 2 +- packages/tui/package.json | 2 +- .../claude/.claude-plugin/plugin.json | 2 +- .../codex/.codex-plugin/plugin.json | 4 +-- .../cursor/.cursor-plugin/plugin.json | 2 +- 26 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 packages/context-cli/src/__tests__/pluginCommandAvailable.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index edb3cc7c..8cfb959a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to Context are documented here. +## 0.7.73 - 2026-10-19 + +- Plugin host discovery now preserves the inherited PATH, matching the environment used to launch commands, and safely quotes executable names. +- Permission-sensitive production submission tests use a native temporary filesystem so shared development mounts do not change their assertions. + ## 0.7.72 - 2026-10-15 - Settling a source update or a revision queue no longer leaves `knowledge/structure.yaml` stale. When citations were relocated or repository content references advanced, the structure kept its previous input hash, so `verify` reported "Structure is stale; run Close" until Close ran again. The hash is now recomputed with the rewritten references; a structure that was already stale stays stale for Close. diff --git a/bun.lock b/bun.lock index 6b94331e..5f99794e 100644 --- a/bun.lock +++ b/bun.lock @@ -18,7 +18,7 @@ }, "packages/context": { "name": "@c4a/context", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "yaml": "^2.5.1", "zod": "^3.23.8", @@ -26,7 +26,7 @@ }, "packages/context-cli": { "name": "@c4a/context-cli", - "version": "0.7.72", + "version": "0.7.73", "bin": { "context": "dist/cli.js", }, @@ -73,7 +73,7 @@ }, "packages/core": { "name": "@c4a/core", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "picomatch": "^4.0.4", "yaml": "^2.4.5", @@ -85,7 +85,7 @@ }, "packages/dev-cli": { "name": "@c4a/dev-cli", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/context": "workspace:*", "@c4a/core": "workspace:*", @@ -97,7 +97,7 @@ }, "packages/extract": { "name": "@c4a/extract", - "version": "0.7.72", + "version": "0.7.73", "bin": { "c4a-extract-code": "./dist/bin/c4a-extract-code.js", }, @@ -112,7 +112,7 @@ }, "packages/extract-contract": { "name": "@c4a/extract-contract", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "graphql": "^16.14.2", @@ -122,7 +122,7 @@ }, "packages/extract-go": { "name": "@c4a/extract-go", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "@c4a/extract": "workspace:*", @@ -132,7 +132,7 @@ }, "packages/extract-mdx": { "name": "@c4a/extract-mdx", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "remark-mdx": "^3.1.1", @@ -144,7 +144,7 @@ }, "packages/extract-proto": { "name": "@c4a/extract-proto", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "zod": "^3.23.8", @@ -152,7 +152,7 @@ }, "packages/extract-rush": { "name": "@c4a/extract-rush", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "typescript": "^5.5.4", @@ -162,7 +162,7 @@ }, "packages/extract-sql": { "name": "@c4a/extract-sql", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "node-sql-parser": "^5.4.0", @@ -171,7 +171,7 @@ }, "packages/extract-style": { "name": "@c4a/extract-style", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "postcss": "^8.5.26", @@ -183,7 +183,7 @@ }, "packages/extract-thrift": { "name": "@c4a/extract-thrift", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "zod": "^3.23.8", @@ -191,7 +191,7 @@ }, "packages/extract-ts": { "name": "@c4a/extract-ts", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "@c4a/core": "workspace:*", "@c4a/extract": "workspace:*", @@ -202,7 +202,7 @@ }, "packages/tui": { "name": "@c4a/tui", - "version": "0.7.72", + "version": "0.7.73", "dependencies": { "ink": "^5.0.0", "react": "^18.3.1", diff --git a/package.json b/package.json index 514895ac..8af8eecb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "context", - "version": "0.7.72", + "version": "0.7.73", "packageManager": "bun@1.3.9", "repository": { "type": "git", diff --git a/packages/context-cli/context-workflow/provider.yaml b/packages/context-cli/context-workflow/provider.yaml index bfd35df4..adf14266 100644 --- a/packages/context-cli/context-workflow/provider.yaml +++ b/packages/context-cli/context-workflow/provider.yaml @@ -1,6 +1,6 @@ schema: agent-graph.provider.v1 id: c4a/context -version: 0.7.72 +version: 0.7.73 name: Context workflow description: Internal work contract for Context knowledge workspaces. graphs: diff --git a/packages/context-cli/package.json b/packages/context-cli/package.json index b85718e8..c5b7c8c1 100644 --- a/packages/context-cli/package.json +++ b/packages/context-cli/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/context-cli", "description": "Local runtime and Agent integration for traceable knowledge production", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/context-cli/src/__tests__/pluginCommandAvailable.test.ts b/packages/context-cli/src/__tests__/pluginCommandAvailable.test.ts new file mode 100644 index 00000000..ddc1d1c6 --- /dev/null +++ b/packages/context-cli/src/__tests__/pluginCommandAvailable.test.ts @@ -0,0 +1,19 @@ +import { expect, test } from "bun:test"; +import { mkdtemp, writeFile, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { commandAvailable } from "../project/pluginInstallTargets.js"; + +test("host discovery uses inherited PATH and treats command names literally", async () => { + const root = await mkdtemp(join(tmpdir(), "context-plugin-path-")); + const previous = process.env.PATH; + try { + await writeFile(join(root, "context test host"), "#!/bin/sh\nexit 0\n", { mode: 0o755 }); + process.env.PATH = `${root}:${previous ?? "/usr/bin:/bin"}`; + expect(await commandAvailable("context test host")).toBe(true); + expect(await commandAvailable("missing-host; true")).toBe(false); + } finally { + process.env.PATH = previous; + await rm(root, { recursive: true, force: true }); + } +}); diff --git a/packages/context-cli/src/__tests__/productionSubmission.integration.test.ts b/packages/context-cli/src/__tests__/productionSubmission.integration.test.ts index 3aa58598..501e3532 100644 --- a/packages/context-cli/src/__tests__/productionSubmission.integration.test.ts +++ b/packages/context-cli/src/__tests__/productionSubmission.integration.test.ts @@ -1,6 +1,7 @@ import { afterEach, expect, test } from "bun:test"; import { chmod, cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { join, resolve } from "node:path"; +import { tmpdir } from "node:os"; import YAML from "yaml"; import { execFileSync, spawnSync } from "node:child_process"; import { completeProductionSubmission, productionSourceBaseline } from "../project/productionSubmission.js"; @@ -34,8 +35,7 @@ import { registerKnowledgeMaintenance, observeKnowledgeMaintenance, maintenanceR const roots: string[] = []; afterEach(async () => { for (const root of roots.splice(0)) await rm(root, { recursive: true, force: true }); }); -async function fixture(initialize = false) { - const parent = resolve(".tmp/production-submission-tests"); +async function fixture(initialize = false, parent = resolve(".tmp/production-submission-tests")) { await mkdir(parent, { recursive: true }); const outer = await mkdtemp(join(parent, "case-")); roots.push(outer); @@ -333,7 +333,8 @@ test("changed long-term scope blocks pending acceptance without discarding accep }); test("accepted production reaches actual Review apply without a Provider compile or revision batch", async () => { - const f = await fixture(true); + // Permission failure checks need native filesystem semantics, not a host bind mount. + const f = await fixture(true, join(tmpdir(), "context-production-submission-tests")); // Isolate formal version discovery from the parent repository's ignored .tmp. execFileSync("git", ["init", "--quiet"], { cwd: f.root }); await expect(readProductionReviewCandidates(f.root)).rejects.toThrow("Complete the current production stage"); diff --git a/packages/context-cli/src/project/indexerBaseContracts.ts b/packages/context-cli/src/project/indexerBaseContracts.ts index a3e4248f..dda3f28c 100644 --- a/packages/context-cli/src/project/indexerBaseContracts.ts +++ b/packages/context-cli/src/project/indexerBaseContracts.ts @@ -21,7 +21,7 @@ import { bundledMarkdownReaderQuestionContracts } from "./indexerBaseMarkdownAuthoringCatalog.js"; const BASE_CONTRACT_VERSION = "1.1.0"; -export const BUNDLED_INDEXER_PARSER_PACKAGE_VERSION = "0.7.72"; +export const BUNDLED_INDEXER_PARSER_PACKAGE_VERSION = "0.7.73"; const BUNDLED_PARSER_REQUIREMENTS = buildIndexerParserCapabilityRequirements( BUNDLED_INDEXER_PARSER_PACKAGE_VERSION, ); diff --git a/packages/context-cli/src/project/pluginInstallTargets.ts b/packages/context-cli/src/project/pluginInstallTargets.ts index f2497c19..595de791 100644 --- a/packages/context-cli/src/project/pluginInstallTargets.ts +++ b/packages/context-cli/src/project/pluginInstallTargets.ts @@ -59,7 +59,8 @@ async function runExternalOptional(command: string, args: readonly string[]): Pr } export async function commandAvailable(command: string): Promise { - return runExternalOptional("sh", ["-lc", `command -v ${command} >/dev/null 2>&1`]); + // Probe the same inherited PATH used by execFile; login profiles can replace it. + return runExternalOptional("sh", ["-c", `command -v ${shellQuote(command)} >/dev/null 2>&1`]); } async function claudePluginInstalled(pluginId: string): Promise { diff --git a/packages/context/package.json b/packages/context/package.json index d23087e1..775ad0ae 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/context", "description": "Declarative SDK for Context knowledge sources, workflows, review, and package outputs", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/core/package.json b/packages/core/package.json index daba9bad..4cf8f24b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/core", "description": "Shared extraction types, schemas, and utilities for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/dev-cli/package.json b/packages/dev-cli/package.json index 950dfdf3..76276e6a 100644 --- a/packages/dev-cli/package.json +++ b/packages/dev-cli/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/dev-cli", "description": "Developer menu for Context build, verification, link, and release preparation", - "version": "0.7.72", + "version": "0.7.73", "private": true, "type": "module", "license": "MIT", diff --git a/packages/extract-contract/package.json b/packages/extract-contract/package.json index eb825fb8..ac554092 100644 --- a/packages/extract-contract/package.json +++ b/packages/extract-contract/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-contract", "description": "OpenAPI and GraphQL contract catalog adapter for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-go/package.json b/packages/extract-go/package.json index 6bb9e0ea..86231cf8 100644 --- a/packages/extract-go/package.json +++ b/packages/extract-go/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-go", "description": "Go extraction plugin and structural index for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-mdx/package.json b/packages/extract-mdx/package.json index d8886931..1472986c 100644 --- a/packages/extract-mdx/package.json +++ b/packages/extract-mdx/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-mdx", "description": "MDX component and example catalog bridge for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-proto/package.json b/packages/extract-proto/package.json index b3354a38..95f10841 100644 --- a/packages/extract-proto/package.json +++ b/packages/extract-proto/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-proto", "description": "Protocol Buffers IDL catalog parser for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-rush/package.json b/packages/extract-rush/package.json index d32e6d26..0dd011fb 100644 --- a/packages/extract-rush/package.json +++ b/packages/extract-rush/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-rush", "description": "Rush workspace structural index for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-sql/package.json b/packages/extract-sql/package.json index cfd4832b..e7535ca6 100644 --- a/packages/extract-sql/package.json +++ b/packages/extract-sql/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-sql", "description": "Dialect-bound lightweight SQL evidence adapter for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-style/package.json b/packages/extract-style/package.json index 3e646e34..46052b23 100644 --- a/packages/extract-style/package.json +++ b/packages/extract-style/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-style", "description": "Lightweight CSS and SCSS evidence adapter for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-thrift/package.json b/packages/extract-thrift/package.json index eb01a0e6..83cf2b8c 100644 --- a/packages/extract-thrift/package.json +++ b/packages/extract-thrift/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-thrift", "description": "Apache Thrift IDL catalog parser for Context", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract-ts/package.json b/packages/extract-ts/package.json index a93aea7d..fc476ad9 100644 --- a/packages/extract-ts/package.json +++ b/packages/extract-ts/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract-ts", "description": "TypeScript and JavaScript extraction plugin for the Context ExtractionResult v2 contract", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/extract/package.json b/packages/extract/package.json index 3d34b9a3..c8db85d7 100644 --- a/packages/extract/package.json +++ b/packages/extract/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/extract", "description": "Language-plugin framework and repository runner for Context code evidence", - "version": "0.7.72", + "version": "0.7.73", "type": "module", "license": "MIT", "engines": { diff --git a/packages/tui/package.json b/packages/tui/package.json index c052af47..b6c4def0 100644 --- a/packages/tui/package.json +++ b/packages/tui/package.json @@ -1,7 +1,7 @@ { "name": "@c4a/tui", "description": "Shared terminal UI components (Ink + React) for Context development tools", - "version": "0.7.72", + "version": "0.7.73", "private": true, "type": "module", "license": "MIT", diff --git a/plugins/context/repo-install/claude/.claude-plugin/plugin.json b/plugins/context/repo-install/claude/.claude-plugin/plugin.json index 2827a018..2f5dc9f4 100644 --- a/plugins/context/repo-install/claude/.claude-plugin/plugin.json +++ b/plugins/context/repo-install/claude/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "c4a", "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.", - "version": "0.7.72", + "version": "0.7.73", "author": { "name": "c4a" }, diff --git a/plugins/context/repo-install/codex/.codex-plugin/plugin.json b/plugins/context/repo-install/codex/.codex-plugin/plugin.json index 17f1af28..79c503c0 100644 --- a/plugins/context/repo-install/codex/.codex-plugin/plugin.json +++ b/plugins/context/repo-install/codex/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "c4a", - "version": "0.7.72", + "version": "0.7.73", "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.", "author": { "name": "c4a" }, "homepage": "https://github.com/context4ai/c4a", @@ -10,7 +10,7 @@ "skills": "./skills/", "interface": { "displayName": "C4A Context", - "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.72", + "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.73", "longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.", "developerName": "c4a", "category": "Productivity", diff --git a/plugins/context/repo-install/cursor/.cursor-plugin/plugin.json b/plugins/context/repo-install/cursor/.cursor-plugin/plugin.json index d4ec5862..4453c14f 100644 --- a/plugins/context/repo-install/cursor/.cursor-plugin/plugin.json +++ b/plugins/context/repo-install/cursor/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "c4a", "displayName": "C4A Context", - "version": "0.7.72", + "version": "0.7.73", "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.", "author": { "name": "Context4AI",