Skip to content

Commit f16dc82

Browse files
committed
fix(installer): bind smoke check to target payload manifest
Release-Sync: yes Release-Version: 2026-03-31.154241 Release-Date: 2026-03-31
1 parent e99b44c commit f16dc82

11 files changed

Lines changed: 69 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@ This changelog is maintained manually (not auto-generated).
66

77
## [Unreleased]
88

9+
## [2026-03-31.154241] - 2026-03-31
10+
11+
### Scripts
12+
13+
- Adjusted maintenance scripts:
14+
- `scripts/install_sopify.py`
15+
16+
### Tests
17+
18+
- Updated automated coverage:
19+
- `tests/test_installer_validate.py`
20+
21+
### Changed
22+
23+
- Updated project files:
24+
- `installer/inspection.py`
25+
- `installer/validate.py`
26+
927
## [2026-03-31.143816] - 2026-03-31
1028

1129
### Scripts

Claude/Skills/CN/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- bootstrap: lang=zh-CN; encoding=UTF-8 -->
2-
<!-- SOPIFY_VERSION: 2026-03-31.143816 -->
2+
<!-- SOPIFY_VERSION: 2026-03-31.154241 -->
33
<!-- ARCHITECTURE: Adaptive Workflow + Layered Rules -->
44

55
# Sopify - 自适应 AI 编程助手

Claude/Skills/EN/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- bootstrap: lang=en-US; encoding=UTF-8 -->
2-
<!-- SOPIFY_VERSION: 2026-03-31.143816 -->
2+
<!-- SOPIFY_VERSION: 2026-03-31.154241 -->
33
<!-- ARCHITECTURE: Adaptive Workflow + Layered Rules -->
44

55
# Sopify - Adaptive AI Programming Assistant

Codex/Skills/CN/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- bootstrap: lang=zh-CN; encoding=UTF-8 -->
2-
<!-- SOPIFY_VERSION: 2026-03-31.143816 -->
2+
<!-- SOPIFY_VERSION: 2026-03-31.154241 -->
33
<!-- ARCHITECTURE: Adaptive Workflow + Layered Rules -->
44

55
# Sopify - 自适应 AI 编程助手

Codex/Skills/EN/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- bootstrap: lang=en-US; encoding=UTF-8 -->
2-
<!-- SOPIFY_VERSION: 2026-03-31.143816 -->
2+
<!-- SOPIFY_VERSION: 2026-03-31.154241 -->
33
<!-- ARCHITECTURE: Adaptive Workflow + Layered Rules -->
44

55
# Sopify - Adaptive AI Programming Assistant

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
1010
[![Docs](https://img.shields.io/badge/docs-CC%20BY%204.0-green.svg)](./LICENSE-docs)
11-
[![Version](https://img.shields.io/badge/version-2026--03--31.143816-orange.svg)](#version-history)
11+
[![Version](https://img.shields.io/badge/version-2026--03--31.154241-orange.svg)](#version-history)
1212
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)
1313

1414
English · [简体中文](./README.zh-CN.md) · [Quick Start](#quick-start) · [Configuration](#configuration) · [Contributors](./CONTRIBUTORS.md)

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[![许可证](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
1010
[![文档](https://img.shields.io/badge/docs-CC%20BY%204.0-green.svg)](./LICENSE-docs)
11-
[![版本](https://img.shields.io/badge/version-2026--03--31.143816-orange.svg)](#版本历史)
11+
[![版本](https://img.shields.io/badge/version-2026--03--31.154241-orange.svg)](#版本历史)
1212
[![欢迎PR](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING_CN.md)
1313

1414
[English](./README.md) · 简体中文 · [快速开始](#快速开始) · [配置说明](#配置说明) · [贡献者](./CONTRIBUTORS.md)

installer/inspection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,10 @@ def _inspect_smoke(
958958

959959
try:
960960
bundle_root = resolve_payload_bundle_root(adapter.payload_root(home_root))
961-
stdout = run_bundle_smoke_check(bundle_root)
961+
stdout = run_bundle_smoke_check(
962+
bundle_root,
963+
payload_manifest_path=adapter.payload_root(home_root) / "payload-manifest.json",
964+
)
962965
evidence = (stdout.splitlines()[0],) if stdout else ()
963966
return InspectionCheck(
964967
host_id=capability.host_id,

installer/validate.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import json
6+
import os
67
from pathlib import Path
78
import re
89
import shlex
@@ -49,24 +50,27 @@ def validate_payload_install(payload_root: Path) -> tuple[Path, ...]:
4950
)
5051

5152

52-
def run_bundle_smoke_check(bundle_root: Path) -> str:
53+
def run_bundle_smoke_check(bundle_root: Path, *, payload_manifest_path: Path | None = None) -> str:
5354
"""Run the vendored bundle smoke check and return its stdout."""
5455
smoke_script = bundle_root / "scripts" / "check-runtime-smoke.sh"
5556
if not smoke_script.is_file():
5657
raise InstallError(f"Missing bundle smoke script: {smoke_script}")
5758

5859
command = ["bash", str(smoke_script)]
60+
env = _build_bundle_smoke_env(payload_manifest_path=payload_manifest_path)
5961
completed = subprocess.run(
6062
command,
6163
capture_output=True,
6264
text=True,
6365
check=False,
66+
env=env,
6467
)
6568
if completed.returncode != 0:
6669
details = _format_smoke_failure_details(
6770
completed=completed,
6871
command=command,
6972
smoke_script=smoke_script,
73+
env=env,
7074
)
7175
raise InstallError(f"Bundle smoke check failed: {details}")
7276
return completed.stdout.strip()
@@ -77,6 +81,7 @@ def _format_smoke_failure_details(
7781
completed: subprocess.CompletedProcess[str],
7882
command: list[str],
7983
smoke_script: Path,
84+
env: dict[str, str],
8085
) -> str:
8186
details = [
8287
f"exit_status={completed.returncode}",
@@ -99,6 +104,7 @@ def _format_smoke_failure_details(
99104
capture_output=True,
100105
text=True,
101106
check=False,
107+
env=env,
102108
)
103109
details.append(f"debug_exit_status={debug_completed.returncode}")
104110
details.append(f"debug_command={_render_command(debug_command)}")
@@ -117,6 +123,13 @@ def _format_smoke_failure_details(
117123
return "; ".join(details)
118124

119125

126+
def _build_bundle_smoke_env(*, payload_manifest_path: Path | None) -> dict[str, str]:
127+
env = dict(os.environ)
128+
if payload_manifest_path is not None:
129+
env["SOPIFY_PAYLOAD_MANIFEST"] = str(payload_manifest_path)
130+
return env
131+
132+
120133
def _render_command(command: list[str]) -> str:
121134
return " ".join(shlex.quote(part) for part in command)
122135

scripts/install_sopify.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ def run_install(*, target_value: str, workspace_value: str | None, repo_root: Pa
8181
payload_install = install_global_payload(adapter, repo_root=repo_root, home_root=resolved_home)
8282
verified_host_paths = validate_host_install(adapter, home_root=resolved_home)
8383
verified_payload_paths = validate_payload_install(payload_install.root)
84-
smoke_output = run_bundle_smoke_check(resolve_payload_bundle_root(payload_install.root))
84+
smoke_output = run_bundle_smoke_check(
85+
resolve_payload_bundle_root(payload_install.root),
86+
payload_manifest_path=payload_install.root / "payload-manifest.json",
87+
)
8588

8689
workspace_bootstrap: BootstrapResult | None = None
8790
bundle_root: Path | None = None

0 commit comments

Comments
 (0)