pantheon-opencode 1.6.0-beta.9 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.global.md +118 -0
- package/AGENTS.md +18 -168
- package/CHANGELOG.md +126 -376
- package/README.md +83 -610
- package/README.pt-BR.md +120 -345
- package/bin/pantheon-init.mjs +366 -132
- package/commands/pantheon-deepwork.md +14 -3
- package/commands/pantheon-vision.md +61 -12
- package/package.json +19 -11
- package/plugin.json +1 -1
- package/pyproject.toml +6 -2
- package/scripts/_pantheon_paths.py +24 -0
- package/scripts/build-agents-md.mjs +368 -69
- package/scripts/changelog-merge.mjs +161 -0
- package/scripts/check-plugin-v2-coverage.mjs +11 -8
- package/scripts/docs-check-changelog.mjs +204 -0
- package/scripts/docs-link-check.mjs +314 -0
- package/scripts/docs-media.mjs +157 -0
- package/scripts/doctor.mjs +828 -40
- package/scripts/install/agents-md.mjs +2 -2
- package/scripts/install/backup.mjs +648 -0
- package/scripts/install/cli-ui.mjs +303 -72
- package/scripts/install/component-selection.mjs +61 -0
- package/scripts/install/config-migration.mjs +583 -27
- package/scripts/install/exit-codes.mjs +26 -0
- package/scripts/install/file-inventory.mjs +555 -0
- package/scripts/install/health-check.mjs +31 -25
- package/scripts/install/interactive.mjs +78 -383
- package/scripts/install/migrate.mjs +49 -25
- package/scripts/install/model-picker.mjs +218 -250
- package/scripts/install/opencode-version.mjs +83 -21
- package/scripts/install/opencode.mjs +1413 -154
- package/scripts/install/plan-artifact.mjs +517 -0
- package/scripts/install/plan.mjs +475 -0
- package/scripts/install/plugin.mjs +214 -27
- package/scripts/install/prompt-result.mjs +2 -0
- package/scripts/install/shared.mjs +256 -99
- package/scripts/install/state.mjs +63 -8
- package/scripts/install/strings.mjs +60 -4
- package/scripts/install/venv.mjs +90 -47
- package/scripts/install/verify.mjs +128 -0
- package/scripts/install/vision-prompt.mjs +173 -0
- package/scripts/install-mcp.mjs +2 -2
- package/scripts/manifest-inventory.mjs +49 -3
- package/scripts/mcp_persistence.py +1535 -1050
- package/scripts/memory_mcp.py +12 -843
- package/scripts/node-engine-policy.mjs +85 -0
- package/scripts/package-evidence.mjs +10 -2
- package/scripts/postinstall.mjs +26 -26
- package/scripts/probe-pantheon-cost.mjs +118 -19
- package/scripts/prune.mjs +9 -3
- package/scripts/reconcile.mjs +325 -0
- package/scripts/release-gates.mjs +682 -0
- package/scripts/restore.mjs +222 -0
- package/scripts/run-node-tests.mjs +24 -8
- package/scripts/sync-artifacts.mjs +19 -7
- package/scripts/sync-tui.mjs +5 -1
- package/scripts/test-opencode-v2-sandbox.sh +36 -123
- package/scripts/uninstall.mjs +369 -34
- package/scripts/update.mjs +164 -0
- package/scripts/validate-node-engine-policy.mjs +13 -0
- package/scripts/version-check.mjs +34 -1
- package/scripts/versioning.mjs +23 -3
- package/scripts/vision-status.mjs +682 -0
- package/skills-lock.json +8 -8
- package/src/agents/aphrodite.md +13 -10
- package/src/agents/apollo.md +4 -5
- package/src/agents/athena.md +74 -46
- package/src/agents/demeter.md +10 -7
- package/src/agents/gaia.md +0 -1
- package/src/agents/hephaestus.md +4 -3
- package/src/agents/hermes.md +10 -9
- package/src/agents/iris.md +6 -1
- package/src/agents/mnemosyne.md +10 -4
- package/src/agents/nyx.md +4 -4
- package/src/agents/prometheus.md +12 -11
- package/src/agents/talos.md +6 -0
- package/src/agents/zeus.md +84 -56
- package/src/instructions/agent-return-format.instructions.md +12 -41
- package/src/instructions/memory-protocol.instructions.md +5 -11
- package/src/instructions/test-economy.instructions.md +12 -0
- package/src/instructions/yagni.instructions.md +6 -15
- package/src/instructions/zeus-anti-stall.instructions.md +6 -6
- package/src/instructions/zeus-communication-rules.instructions.md +6 -6
- package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
- package/src/instructions/zeus-memory-operations.instructions.md +13 -7
- package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
- package/src/mcp/_pantheon_paths.py +24 -0
- package/src/mcp/mcp_codemap_module.py +86 -18
- package/src/mcp/mcp_persistence.py +1535 -1050
- package/src/mcp/memory_mcp.py +444 -94
- package/src/mcp/pantheon_vision.py +285 -41
- package/src/mcp/requirements-mcp.txt +5 -0
- package/src/pantheon/context-pruner.ts +541 -0
- package/src/pantheon/cost-command.ts +814 -60
- package/src/pantheon/goal-loop.ts +11 -8
- package/src/pantheon/memory-context.ts +1017 -0
- package/src/pantheon/model-agents.ts +19 -0
- package/src/pantheon/model-command.ts +218 -56
- package/src/pantheon/model-pricing.ts +536 -0
- package/src/pantheon/presets.mjs +2 -0
- package/src/pantheon/task-result-guard.ts +50 -14
- package/src/pantheon/v2-bounded-read.ts +640 -0
- package/src/pantheon/v2-delegation-enforce.ts +133 -6
- package/src/pantheon/v2-execute-after.ts +135 -24
- package/src/pantheon/v2-model-overrides.ts +275 -0
- package/src/pantheon/v2-tools.ts +89 -35
- package/src/pantheon/v2-unsupported.mjs +2 -3
- package/src/pantheon/v2-vision.ts +622 -0
- package/src/pantheon/vision-local.ts +531 -0
- package/src/pantheon/vision.ts +1160 -115
- package/src/plugin-v2.ts +654 -162
- package/src/plugin.ts +15 -11
- package/src/plugins/tui/dist/tui-v2.d.ts +1029 -2
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +3742 -85
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +6 -6
- package/src/plugins/tui/package.json +5 -4
- package/src/plugins/tui/src/index-v2.tsx +4314 -50
- package/src/plugins/tui/tsconfig.typecheck.json +5 -0
- package/src/routing.yml +50 -5
- package/src/skills/agent-coordination/SKILL.md +7 -2
- package/src/skills/artifact-management/SKILL.md +5 -1
- package/src/skills/auto-continue/SKILL.md +14 -6
- package/src/skills/codemap/SKILL.md +1 -1
- package/src/skills/memory-bank/SKILL.md +21 -13
- package/src/skills/session-goal/SKILL.md +12 -22
- package/src/skills/spec-driven-development/SKILL.md +3 -1
- package/src/skills/worktrees/SKILL.md +30 -11
- package/scripts/probe-context-rehydrate.mjs +0 -263
|
@@ -14,33 +14,80 @@ not being described, switching between native and tool mode.
|
|
|
14
14
|
|
|
15
15
|
1. **Check connectivity & key source**
|
|
16
16
|
- Read the opencode auth store: `<data dir>/auth.json`
|
|
17
|
-
(default `~/.local/share/opencode/auth.json
|
|
18
|
-
|
|
17
|
+
(default `~/.local/share/opencode/auth.json`) via `readOpencodeAuthToken`.
|
|
18
|
+
- Credentials follow the endpoint (never cross providers):
|
|
19
|
+
- **Zen endpoints** (`opencode`, `opencode-go*`): the env keys
|
|
20
|
+
`PANTHEON_OPENCODE_API_KEY` / `OPENCODE_API_KEY` first, then the auth
|
|
21
|
+
store — the resolved provider entry first, then the legacy Zen entries
|
|
22
|
+
`opencode-go` then `opencode`.
|
|
23
|
+
- **Non-Zen endpoints** (e.g. discovered OpenAI-compatible providers):
|
|
24
|
+
ONLY that provider's own auth-store entry. The shared Zen env keys and
|
|
25
|
+
the legacy `opencode-go` / `opencode` entries are never attached to a
|
|
26
|
+
non-Zen base URL; absent an own credential the image falls through to
|
|
27
|
+
the tool→local chain.
|
|
19
28
|
- Report whether the user is connected (`opencode auth login`) or has an
|
|
20
|
-
env key
|
|
29
|
+
env key — for a non-Zen target, report the target provider's own entry.
|
|
21
30
|
- **Never log or echo the token itself** — only connected/not connected.
|
|
22
31
|
|
|
23
|
-
2. **Show current status**
|
|
32
|
+
2. **Show current status (mode + resolved target + origin)**
|
|
24
33
|
- Effective mode precedence: env `PANTHEON_VISION_MODE` > config file
|
|
25
34
|
`mode` > default `auto`.
|
|
26
|
-
-
|
|
27
|
-
|
|
35
|
+
- Resolved target + origin, in precedence order:
|
|
36
|
+
env `PANTHEON_VISION_MODEL` → config `visionModel` (project
|
|
37
|
+
`.opencode/opencode-vision.json`, then user
|
|
38
|
+
`~/.config/opencode/opencode-vision.json`) → active preset `vision.model`
|
|
39
|
+
→ **automatic discovery** in the host catalog (`GET /config/providers`)
|
|
40
|
+
→ built-in default.
|
|
41
|
+
- Resolve the installed helper first (do not assume the current project
|
|
42
|
+
contains Pantheon source). Check, in order:
|
|
43
|
+
`$OPENCODE_CONFIG_DIR/.opencode/scripts/`,
|
|
44
|
+
`$OPENCODE_CONFIG_DIR/scripts/`,
|
|
45
|
+
`${XDG_CONFIG_HOME:-$HOME/.config}/opencode/scripts/`,
|
|
46
|
+
`$HOME/.opencode/scripts/`, `.opencode/scripts/`, then
|
|
47
|
+
`$(npm root -g)/pantheon-opencode/scripts/`. Run the first existing
|
|
48
|
+
`vision-status.mjs` as `node "$helper" --dir="$PWD"` and show its output
|
|
49
|
+
(mode + target + origin). The same helper drives the picker with
|
|
50
|
+
`--list` (enumerate candidates) and `--set <provider/model>` (pin one).
|
|
51
|
+
- If the helper is missing, resolve inline with the same precedence and be
|
|
52
|
+
honest: discovery needs the live host catalog, so when no explicit model
|
|
53
|
+
is configured report `auto (resolved at session start)` and name the
|
|
54
|
+
fallback default — never invent a value.
|
|
28
55
|
|
|
29
56
|
3. **Ask what to set (interactive)**
|
|
30
57
|
- **Mode:** `native` | `tool` | `auto`
|
|
31
|
-
- `native` — describe images via the multimodal model directly (needs
|
|
58
|
+
- `native` — describe images via the multimodal model directly (needs a
|
|
59
|
+
usable credential for the resolved endpoint)
|
|
32
60
|
- `tool` — always use the MCP tool fallback (`imageAnalysisTool`)
|
|
33
61
|
- `auto` — try native first, fall back to the tool (default)
|
|
34
|
-
- **Vision model
|
|
35
|
-
|
|
36
|
-
`
|
|
62
|
+
- **Vision model — show the picker, do NOT make the user type blind.**
|
|
63
|
+
Run `node "$helper" --list --dir="$PWD"` and present its numbered list.
|
|
64
|
+
- **Read the `Source:` line out loud.** It is `host catalog`
|
|
65
|
+
(`capabilities.input.image`) when the live catalog is available, or
|
|
66
|
+
`heuristic` (`opencode models` + known vision families) otherwise — the
|
|
67
|
+
heuristic is a *guess*, so say so; never present it as certain.
|
|
68
|
+
- Each row shows `Access` (free/paid when the catalog reports cost) and
|
|
69
|
+
`Credential`. **`Credential: no` means the native path has no key for
|
|
70
|
+
that provider, so images degrade to the MCP tool fallback (which then
|
|
71
|
+
falls back to local metadata like EXIF/size) — that is expected, not an
|
|
72
|
+
error.** `yes (env|store)` means a key is present (never echo it).
|
|
73
|
+
- Let the user choose by **number** or type a `provider/model`. Then apply
|
|
74
|
+
it with `node "$helper" --set <provider/model> --dir="$PWD"` (add
|
|
75
|
+
`--global` to pin in the user config; default is the project config).
|
|
76
|
+
- If the list is empty, report the helper's `Source: none` reason (e.g.
|
|
77
|
+
`opencode models` unavailable) and let the user type the model manually.
|
|
78
|
+
- Precedence for the effective model is unchanged: env
|
|
79
|
+
`PANTHEON_VISION_MODEL` > config `visionModel` > active preset
|
|
80
|
+
`vision.model` > automatic discovery > default `opencode-go/mimo-v2.5`.
|
|
37
81
|
- **Tool fallback:** `imageAnalysisTool` (default
|
|
38
82
|
`pantheon_vision_vision_describe`). Bifrost is opt-in only when
|
|
39
83
|
explicitly selected here or through `PANTHEON_VISION_TOOL`.
|
|
40
84
|
|
|
41
85
|
4. **Save the config**
|
|
42
|
-
-
|
|
43
|
-
(
|
|
86
|
+
- The `--set` in step 3 already merged `visionModel` atomically
|
|
87
|
+
(`.bak` backup, existing keys preserved, corrupted JSON left untouched).
|
|
88
|
+
If the user typed a model instead of using `--set`, apply it the same way.
|
|
89
|
+
- Default target: project config `.opencode/opencode-vision.json`
|
|
90
|
+
(resolved alongside the user config `~/.config/opencode/opencode-vision.json`;
|
|
44
91
|
project wins on conflicts).
|
|
45
92
|
- `--global` → write to `~/.config/opencode/opencode-vision.json`.
|
|
46
93
|
- Shape:
|
|
@@ -65,3 +112,5 @@ not being described, switching between native and tool mode.
|
|
|
65
112
|
- Do NOT print tokens or auth.json contents.
|
|
66
113
|
- Do NOT overwrite existing config keys not being changed — merge.
|
|
67
114
|
- If the config file is corrupted JSON, warn and ask before overwriting.
|
|
115
|
+
- State the picker's `Source:` (catalog vs heuristic) honestly — a heuristic
|
|
116
|
+
list is a guess; never imply certainty about image capability.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-opencode",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"postinstall": "node scripts/postinstall.mjs && node scripts/sync-tui.mjs",
|
|
20
20
|
"prepare": "husky",
|
|
21
|
-
"setup": "node bin/pantheon-init.mjs init",
|
|
21
|
+
"setup": "node bin/pantheon-init.mjs init --yes",
|
|
22
22
|
"build:agents-md": "node scripts/build-agents-md.mjs",
|
|
23
|
-
"setup:lite": "node bin/pantheon-init.mjs init --clean --components agents,skills,instructions",
|
|
23
|
+
"setup:lite": "node bin/pantheon-init.mjs init --yes --clean --components agents,skills,instructions",
|
|
24
24
|
"doctor": "node scripts/doctor.mjs",
|
|
25
25
|
"prune": "node scripts/prune.mjs",
|
|
26
|
-
"init": "node bin/pantheon-init.mjs init",
|
|
26
|
+
"init": "node bin/pantheon-init.mjs init --yes",
|
|
27
27
|
"opencode": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
|
|
28
28
|
"start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
|
|
29
29
|
"prepublishOnly": "node scripts/validate-routing.mjs",
|
|
@@ -33,16 +33,21 @@
|
|
|
33
33
|
"version:check": "node scripts/version-check.mjs",
|
|
34
34
|
"release:dry-run": "node scripts/versioning.mjs status && node scripts/release-notes.mjs && node scripts/package-evidence.mjs",
|
|
35
35
|
"package:evidence": "node scripts/package-evidence.mjs",
|
|
36
|
-
"
|
|
36
|
+
"engine:check": "node scripts/validate-node-engine-policy.mjs",
|
|
37
|
+
"package:validate": "node scripts/validate-package.mjs && npm run engine:check",
|
|
37
38
|
"lint": "biome ci .",
|
|
39
|
+
"docs:lint": "node scripts/docs-link-check.mjs",
|
|
40
|
+
"docs:media": "node scripts/docs-media.mjs",
|
|
41
|
+
"docs:check-changelog": "node scripts/docs-check-changelog.mjs",
|
|
38
42
|
"typecheck": "tsc --noEmit",
|
|
39
43
|
"audit": "npm audit --audit-level=high",
|
|
40
44
|
"secret-scan": "node scripts/secret-scan.mjs",
|
|
41
45
|
"hooks:install": "pre-commit install",
|
|
42
46
|
"hooks:update": "pre-commit autoupdate",
|
|
43
47
|
"test:security": "npm run secret-scan",
|
|
44
|
-
"test:node": "node scripts/run-node-tests.mjs --label 'test:node' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
|
|
45
|
-
"
|
|
48
|
+
"test:node": "node scripts/run-node-tests.mjs --label 'test:node' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
|
|
49
|
+
"test:install": "PANTHEON_RUN_INSTALL_TESTS=1 node scripts/run-node-tests.mjs --label 'test:install' 'tests/install-opencode.test.mjs' 'tests/install-e2e.test.mjs'",
|
|
50
|
+
"coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node scripts/run-node-tests.mjs --label 'coverage' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' -- --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
|
|
46
51
|
"coverage:plugin-v2": "node scripts/check-plugin-v2-coverage.mjs",
|
|
47
52
|
"test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-v2-contract.test.ts ]; then NODE_OPTIONS=--conditions=import tsx \"$f\"; else tsx \"$f\"; fi || exit 1; done",
|
|
48
53
|
"test:hooks": "node scripts/run-node-tests.mjs --label 'test:hooks' 'tests/pantheon/plugin-v2-hook-canary.test.mjs'",
|
|
@@ -75,6 +80,7 @@
|
|
|
75
80
|
"!src/agents/README.md",
|
|
76
81
|
"bin/*.mjs",
|
|
77
82
|
"AGENTS.md",
|
|
83
|
+
"AGENTS.global.md",
|
|
78
84
|
"CHANGELOG.md",
|
|
79
85
|
"src/mcp/*.py",
|
|
80
86
|
"src/instructions/*.instructions.md",
|
|
@@ -97,10 +103,11 @@
|
|
|
97
103
|
"!**/*.pyc"
|
|
98
104
|
],
|
|
99
105
|
"dependencies": {
|
|
106
|
+
"@clack/prompts": "1.8.1",
|
|
100
107
|
"@opencode-ai/plugin": "1.18.33",
|
|
108
|
+
"@opencode-ai/sdk": "1.18.33",
|
|
101
109
|
"js-yaml": "^5.4.2",
|
|
102
|
-
"zod": "4.1.8"
|
|
103
|
-
"@opencode-ai/sdk": "1.18.33"
|
|
110
|
+
"zod": "4.1.8"
|
|
104
111
|
},
|
|
105
112
|
"devDependencies": {
|
|
106
113
|
"@biomejs/biome": "2.5.14",
|
|
@@ -115,7 +122,8 @@
|
|
|
115
122
|
"@babel/core": "7.29.7",
|
|
116
123
|
"seroval": "1.6.8",
|
|
117
124
|
"solid-js": "1.9.12",
|
|
118
|
-
"rolldown": "1.2.7"
|
|
125
|
+
"rolldown": "1.2.7",
|
|
126
|
+
"toml": "5.0.1"
|
|
119
127
|
},
|
|
120
128
|
"//overrides": "TUI production advisory fixes: Babel >=7.29.6 and Seroval >=1.6.3; Solid stays at 1.9.12 to satisfy OpenTUI's exact peer. Remove only after upstream ranges include fixed versions; Seroval compatibility is covered by the Solid serializer regression test.",
|
|
121
129
|
"repository": {
|
|
@@ -137,7 +145,7 @@
|
|
|
137
145
|
"author": "ils15",
|
|
138
146
|
"license": "MIT",
|
|
139
147
|
"engines": {
|
|
140
|
-
"node": "
|
|
148
|
+
"node": ">=26.4.0"
|
|
141
149
|
},
|
|
142
150
|
"preferGlobal": true
|
|
143
151
|
}
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "1.6.0
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 20 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
package/pyproject.toml
CHANGED
|
@@ -4,10 +4,14 @@ build-backend = "setuptools.backends._legacy:_Backend"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pantheon"
|
|
7
|
-
version = "1.6.0
|
|
7
|
+
version = "1.6.0"
|
|
8
8
|
description = "Multi-agent orchestration framework"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
|
-
|
|
10
|
+
# Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
|
|
11
|
+
# are installed from src/mcp/requirements-*.txt by the installer, not from this
|
|
12
|
+
# metadata. typing_extensions is declared here because src/mcp/memory_mcp.py
|
|
13
|
+
# imports it directly (TypedDict must come from typing_extensions on 3.11).
|
|
14
|
+
dependencies = ["typing_extensions>=4.14.1"]
|
|
11
15
|
|
|
12
16
|
[tool.pytest.ini_options]
|
|
13
17
|
# `tests/` holds the main suite; the entry below is an orphaned test module
|
|
@@ -72,6 +72,30 @@ def pantheon_project() -> Path | None:
|
|
|
72
72
|
return None
|
|
73
73
|
|
|
74
74
|
|
|
75
|
+
def trusted_project_root() -> Path | None:
|
|
76
|
+
"""Return an explicitly host-bound project root, or ``None``.
|
|
77
|
+
|
|
78
|
+
The globally launched Memory MCP commonly runs with its working directory
|
|
79
|
+
set to the installed runtime, not the active project. Therefore this
|
|
80
|
+
security-sensitive lookup deliberately accepts only an absolute
|
|
81
|
+
``PANTHEON_PROJECT`` binding and never falls back to ``PWD`` or cwd.
|
|
82
|
+
"""
|
|
83
|
+
configured_root = os.environ.get("PANTHEON_PROJECT")
|
|
84
|
+
if not configured_root:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
candidate = Path(configured_root)
|
|
88
|
+
if not candidate.is_absolute():
|
|
89
|
+
return None
|
|
90
|
+
try:
|
|
91
|
+
root = candidate.resolve(strict=True)
|
|
92
|
+
except (OSError, RuntimeError):
|
|
93
|
+
return None
|
|
94
|
+
if not root.is_dir() or root == Path(root.anchor):
|
|
95
|
+
return None
|
|
96
|
+
return root
|
|
97
|
+
|
|
98
|
+
|
|
75
99
|
def _is_valid_logical_cwd(logical_cwd: str, physical_cwd: str) -> bool:
|
|
76
100
|
"""Validate a launcher-provided logical cwd without resolving its result.
|
|
77
101
|
|