docs(runtime): document supported platform pinning - #348
Conversation
📝 WalkthroughWalkthroughChangesPlatform selection contract
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/ci/test_unica_skills.py (1)
1470-1474: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winVerify the complete platform-selection contract.
These assertions check token presence anywhere in
runtime_build. They do not require the document to statev8-runner0.5.1 or the maximum-version fallback. A later edit can remove the selection rule while all five assertions still pass. Scope the checks to## Выбор платформы 1Сand assert the version-specific behavior.[details]
Suggested test additions
+ selection = runtime_build.split("## Выбор платформы 1С", 1)[1] + self.assertIn("0.5.1", selection) + self.assertIn("максимальную найденную версию", selection)[/details]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ci/test_unica_skills.py` around lines 1470 - 1474, Strengthen the assertions in the test containing the runtime_build checks by extracting the `## Выбор платформы 1С` section and validating its version-specific platform-selection rules, including `v8-runner` version 0.5.1 and the maximum-version fallback. Keep the existing token and exclusion checks scoped to that section so unrelated document content cannot satisfy them.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/unica/references/tooling/runtime-build.md`:
- Around line 436-439: The platform-selection documentation in
plugins/unica/references/tooling/runtime-build.md (lines 436-439) must
explicitly state the v8-runner version as 0.5.1 and describe its maximum-version
fallback when no platform restriction is provided. Update the CI coverage in
tests/ci/test_unica_skills.py (lines 1470-1474) to verify both the pinned
v8-runner version and maximum-version fallback behavior, rather than checking
only key presence.
---
Nitpick comments:
In `@tests/ci/test_unica_skills.py`:
- Around line 1470-1474: Strengthen the assertions in the test containing the
runtime_build checks by extracting the `## Выбор платформы 1С` section and
validating its version-specific platform-selection rules, including `v8-runner`
version 0.5.1 and the maximum-version fallback. Keep the existing token and
exclusion checks scoped to that section so unrelated document content cannot
satisfy them.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4ba44e53-287c-4630-9472-3bd012e9e5f1
📒 Files selected for processing (2)
plugins/unica/references/tooling/runtime-build.mdtests/ci/test_unica_skills.py
| Закреплённый `v8-runner` выбирает платформу по `tools.platform.version` и | ||
| `tools.platform.path` в `v8project.yaml` или локальном | ||
| `v8project.local.yaml`. Без явного ограничения он использует максимальную | ||
| найденную версию. Например, проект может ограничить семейство платформы: |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- documentation context ---'
sed -n '410,465p' plugins/unica/references/tooling/runtime-build.md
printf '%s\n' '--- CI test context ---'
sed -n '1435,1495p' tests/ci/test_unica_skills.py
printf '%s\n' '--- relevant references ---'
rg -n -i --glob '!target/**' --glob '!.build/**' --glob '!dist/**' \
'v8-runner|0\.5\.1|maximum|максималь|tools\.platform\.(version|path)|V8_(PATH|BASE)' \
plugins/unica tests/ciRepository: IngvarConsulting/unica
Length of output: 23792
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- current change summary ---'
git status --short
git diff --stat
git diff -- plugins/unica/references/tooling/runtime-build.md tests/ci/test_unica_skills.py
printf '%s\n' '--- project platform contract ---'
sed -n '1,145p' plugins/unica/references/tooling/v8project.md
printf '%s\n' '--- lock metadata ---'
sed -n '52,88p' plugins/unica/third-party/tools.lock.json
sed -n '35,52p' plugins/unica/ATTRIBUTIONS.md
printf '%s\n' '--- provenance and version assertions ---'
sed -n '350,400p' tests/ci/test_skill_provenance.py
sed -n '600,625p' tests/ci/test_skill_provenance.pyRepository: IngvarConsulting/unica
Length of output: 13557
🌐 Web query:
alkoleft v8-runner-rust 0.5.1 tools.platform.version maximum platform version v8project
💡 Result:
In the context of the alkoleft/v8-runner-rust project (a CLI and MCP server for 1C development workflow), v0.5.1 is a specific software release [1]. Regarding your query on configuration and platform version handling: In v0.5.1, the tool supports configuration options such as tools.platform.path and tools.platform.version [2]. These settings allow for pinning the 1C platform for reproducible CI/CD workflows [2]. Specifically: 1. Platform Resolution: The locator mechanism in v0.5.1 matches platform candidates against the configured version [2]. 2. Strict Mode: Subsequent improvements (notably in PR #37) added an opt-in tools.platform.strict mode [3]. When enabled, this enforces a strict path and version resolution policy, ensuring that if a tools.platform.path is provided, the tool performs a fail-closed check rather than falling back to system PATH or other defaults [2][3]. 3. Version Validation: The tool validates exact platform versions and ensures consistency across components like 1cv8, 1cv8c, and ibcmd by requiring them to resolve to the same canonical installation root [3]. There is no native concept of a "maximum platform version" inherent to the v8-runner-rust tool's own configuration schema; rather, it focuses on enforcing the specific version explicitly required by the user to ensure consistency and reliability [2][3]. The "maximum" limitations mentioned in other contexts (like NativeScript or Ionic) refer to SDK or framework compatibility, which are distinct from the version-pinning logic implemented in v8-runner-rust [4][5][6]. If you are encountering issues with platform resolution, ensure that your configuration uses the explicit tools.platform.path and tools.platform.version keys, and consider enabling tools.platform.strict: true to harden the resolution process [2][3].
Citations:
- 1: https://github.com/alkoleft/v8-runner-rust/releases/tag/v0.5.1
- 2: platform locator: path hint должен быть fail-closed и проверять version alkoleft/v8-runner-rust#28
- 3: fix(platform): enforce strict path and version resolution alkoleft/v8-runner-rust#37
- 4: https://docs.nativescript.org/guide/platform-version-handling
- 5: https://ionicframework.com/docs/reference/support
- 6: https://beta.docs.nativescript.org/guide/platform-version-handling
🏁 Script executed:
#!/bin/bash
set -eu
api='https://api.github.com/repos/alkoleft/v8-runner-rust'
printf '%s\n' '--- issue 28 ---'
curl -fsSL "$api/issues/28" | jq '{number,title,state,body,html_url}'
printf '%s\n' '--- pull request 37 ---'
curl -fsSL "$api/pulls/37" | jq '{number,title,state,merged,body,html_url,merge_commit_sha}'
printf '%s\n' '--- release 0.5.1 ---'
curl -fsSL "$api/releases/tags/v0.5.1" | jq '{tag_name,target_commitish,name,body,html_url}'
printf '%s\n' '--- source tree at locked source commit ---'
curl -fsSL "$api/git/trees/72d346c0a8fcf8373d9388257d11e6bef0ad70b2?recursive=1" |
jq -r '.tree[] | select(.path | test("platform|locat|config|project|version"; "i")) | "\(.type)\t\(.path)"' |
head -120Repository: IngvarConsulting/unica
Length of output: 463
🌐 Web query:
site:github.com/alkoleft/v8-runner-rust/issues/28 "tools.platform"
💡 Result:
GitHub Issue #28: “platform locator: path hint должен быть fail-closed и проверять version”.
It reports that tools.platform.path and tools.platform.version are not enforced together: mismatched or invalid paths can silently fall back to another installation via default roots or PATH. Proposed fix: strict fail-closed behavior, version validation, consistent installation roots, and resolution metadata. [1]
[1] (github.com)
Citations:
- 1: platform locator: path hint должен быть fail-closed и проверять version alkoleft/v8-runner-rust#28
🌐 Web query:
site:github.com/alkoleft/v8-runner-rust/pull/37 "tools.platform"
💡 Result:
No indexed results were found for:
site:github.com/alkoleft/v8-runner-rust/pull/37 "tools.platform"
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
import io
import tarfile
import urllib.request
urls = {
"v0.5.1": "https://codeload.github.com/alkoleft/v8-runner-rust/tar.gz/refs/tags/v0.5.1",
"locked-source-commit": "https://codeload.github.com/alkoleft/v8-runner-rust/tar.gz/72d346c0a8fcf8373d9388257d11e6bef0ad70b2",
}
needles = (
"tools.platform",
"platform.version",
"platform.path",
"max",
"maximum",
"strict",
"PATH",
)
for label, url in urls.items():
print(f"--- {label} ---")
try:
data = urllib.request.urlopen(url, timeout=30).read()
except Exception as exc:
print(f"download failed: {exc}")
continue
with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as archive:
matches = []
for member in archive.getmembers():
if not member.isfile():
continue
try:
text = archive.extractfile(member).read().decode("utf-8")
except (UnicodeDecodeError, AttributeError):
continue
if any(needle in text for needle in needles):
matches.append((member.name, text))
print("matching files:", len(matches))
for name, text in matches:
print(f"### {name}")
lines = text.splitlines()
for number, line in enumerate(lines, 1):
if any(needle in line for needle in needles):
start = max(1, number - 3)
end = min(len(lines), number + 5)
for i in range(start, end + 1):
print(f"{i}: {lines[i-1]}")
print()
PYRepository: IngvarConsulting/unica
Length of output: 508
🌐 Web query:
"platform locator" "path hint" "v8-runner"
💡 Result:
In the context of v8-runner-rust, a tool for local 1C:Enterprise development workflows, a platform locator path hint refers to a configuration setting used to specify the directory path of the 1C:Enterprise platform installation [1][2]. The path hint mechanism in v8-runner-rust is designed to locate the required platform executables (such as 1cv8, 1cv8c, or ibcmd) [1]. Technical details regarding this feature include: 1. Functionality: The platform locator attempts to resolve the path specified by the configuration hint [1]. If the hint is missing or invalid, it typically falls back to searching other locations, including hint roots, default installation roots, and the system PATH [1]. 2. Strict Mode: Recent updates (e.g., in v8-runner-rust version 0.5.1 and subsequent patches) introduced a strict mode, configurable via tools.platform.strict [3]. When enabled, the locator becomes fail-closed: if the specified path hint does not contain the required executable or fails to match the configured version, it returns an error instead of falling back to a different platform installation [1][3]. 3. Consistency: In strict mode, the locator enforces that 1cv8, 1cv8c, and ibcmd are all resolved from the same canonical installation root to ensure consistency [3]. This path hint is part of the broader configuration for managing platform versions and ensuring reproducible environments for CI/CD and local development [1]. It should not be confused with similarly named concepts in other technologies, such as Adobe's location hints for network routing [4] or CMake's find_path command [5].
Citations:
- 1: platform locator: path hint должен быть fail-closed и проверять version alkoleft/v8-runner-rust#28
- 2: https://github.com/alkoleft/v8-runner-rust
- 3: fix(platform): enforce strict path and version resolution alkoleft/v8-runner-rust#37
- 4: https://developer.adobe.com/data-collection-apis/docs/getting-started/location-hints
- 5: https://cmake.org/cmake/help/v4.0/command/find_path.html
🏁 Script executed:
#!/bin/bash
set -eu
for ref in 'refs/tags/v0.5.1' '72d346c0a8fcf8373d9388257d11e6bef0ad70b2'; do
printf '\n--- %s ---\n' "$ref"
curl -kfsSL "https://codeload.github.com/alkoleft/v8-runner-rust/tar.gz/$ref" |
python3 -c '
import io, sys, tarfile
needles = (
"tools.platform", "platform.version", "platform.path",
"max", "maximum", "strict", "PATH",
)
data = sys.stdin.buffer.read()
with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as archive:
for member in archive.getmembers():
if not member.isfile():
continue
try:
text = archive.extractfile(member).read().decode("utf-8")
except (UnicodeDecodeError, AttributeError):
continue
lines = text.splitlines()
hits = [i for i, line in enumerate(lines) if any(n in line for n in needles)]
if not hits:
continue
print(f"### {member.name}")
emitted = set()
for hit in hits:
for i in range(max(0, hit - 3), min(len(lines), hit + 6)):
if i not in emitted:
print(f"{i + 1}: {lines[i]}")
emitted.add(i)
print()
'
doneRepository: IngvarConsulting/unica
Length of output: 50379
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- repository commit context ---'
git log -1 --oneline --decorate
git show --stat --oneline HEAD
git show --format=fuller --no-ext-diff HEAD -- \
plugins/unica/references/tooling/runtime-build.md \
tests/ci/test_unica_skills.py \
plugins/unica/third-party/tools.lock.json \
plugins/unica/ATTRIBUTIONS.md
printf '%s\n' '--- exact upstream resolver and decision excerpts ---'
for ref in 'refs/tags/v0.5.1' '72d346c0a8fcf8373d9388257d11e6bef0ad70b2'; do
printf '\n### %s\n' "$ref"
curl -kfsSL "https://codeload.github.com/alkoleft/v8-runner-rust/tar.gz/$ref" |
python3 -c '
import io, sys, tarfile
data = sys.stdin.buffer.read()
wanted = (
"src/platform/locator.rs",
"src/platform/version.rs",
"spec/decisions/0004-avtoobnaruzhivat-komponenty-platformy-1s-po-versii-maske.md",
"Cargo.toml",
)
with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as archive:
for member in archive.getmembers():
if not member.isfile() or not any(member.name.endswith(path) for path in wanted):
continue
try:
text = archive.extractfile(member).read().decode("utf-8")
except (UnicodeDecodeError, AttributeError):
continue
print(f"--- {member.name} ---")
lines = text.splitlines()
for i, line in enumerate(lines):
if any(term in line for term in (
"PlatformVersionRequirement", "max_by", "maximum", "version",
"strict", "tools.platform", "0.5.1",
)):
start = max(0, i - 2)
end = min(len(lines), i + 4)
for j in range(start, end):
print(f"{j + 1}: {lines[j]}")
print()
'
doneRepository: IngvarConsulting/unica
Length of output: 50380
Keep the v8-runner 0.5.1 platform-selection contract consistent.
State v8-runner 0.5.1 and its maximum-version fallback in runtime-build.md. Extend the CI test to check both rules, not only key presence.
📍 Affects 2 files
plugins/unica/references/tooling/runtime-build.md#L436-L439(this comment)tests/ci/test_unica_skills.py#L1470-L1474
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/unica/references/tooling/runtime-build.md` around lines 436 - 439,
The platform-selection documentation in
plugins/unica/references/tooling/runtime-build.md (lines 436-439) must
explicitly state the v8-runner version as 0.5.1 and describe its maximum-version
fallback when no platform restriction is provided. Update the CI coverage in
tests/ci/test_unica_skills.py (lines 1470-1474) to verify both the pinned
v8-runner version and maximum-version fallback behavior, rather than checking
only key presence.
Что изменено
V8_PATHиV8_BASE;tools.platform.versionиtools.platform.path;v8project.local.yaml;Причина
Раздел был перенесён из старого справочного корпуса и расходился с закреплённым
v8-runner0.5.1: раннер не читаетV8_PATHилиV8_BASE, а выбирает платформу черезtools.platform. Без явного ограничения он намеренно выбирает максимальную найденную версию.Related to #321.
Проверка
Summary by CodeRabbit