Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ tokio = { version = "1", features = ["io-std", "io-util", "macros", "net", "proc
tokio-util = "0.7"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }

[target.'cfg(any(windows, target_os = "macos"))'.dependencies]
unicode-casefold = "0.2"
unicode-normalization = "0.1"

[target.'cfg(windows)'.dependencies]
process-wrap = { version = "9.1.0", default-features = false, features = ["std", "job-object", "creation-flags"] }
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Console"] }
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] }

[dev-dependencies]
assert_cmd = "2"
Expand Down
33 changes: 29 additions & 4 deletions SKILL/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,25 @@ Useful global flags:

1. Check whether `v8project.yaml` exists in the 1C project root.
2. If it is missing and source files already exist, run the narrowest `v8-runner config init ...` command that fits the project shape.
3. If it is missing and the current source of truth is an existing infobase, run `v8-runner bootstrap --connection <CONNECTION> --platform-version <VERSION>`.
4. Inspect generated `v8project.yaml` and keep machine-local overrides in generated `v8project.local.yaml`.
5. Run `v8-runner init` only when the file infobase or EDT workspace needs to be created.
6. Run the narrowest validation command that answers the user's goal.
3. If it is missing and the only goal is to export CF/CFE/DT from an existing infobase, create a
minimal `v8project.yaml` with `workPath`, `builder`, `infobase`, platform discovery settings and
`source-set: []`; do not bootstrap project sources that the user did not request.
4. If it is missing and the current source of truth is an existing infobase that must become
project sources, run `v8-runner bootstrap --connection <CONNECTION> --platform-version <VERSION>`.
5. Inspect generated `v8project.yaml` and keep machine-local overrides in generated `v8project.local.yaml`.
6. Run `v8-runner init` only when the file infobase or EDT workspace needs to be created.
7. Run the narrowest validation command that answers the user's goal.

Minimal infobase-only shape:

```yaml
workPath: build/v8-runner
format: DESIGNER
builder: DESIGNER
infobase:
connection: "File=/absolute/path/to/ib"
source-set: []
```

Useful bootstrap commands:

Expand Down Expand Up @@ -83,6 +98,16 @@ v8-runner init
- Vanessa Automation debugging or scenario authoring: use `v8-runner launch mcp va --wait-ready ...` to start the client MCP server with VA loaded and verify the VA MCP tools before driving `.feature` workflows.
- Extension properties need synchronization: use `v8-runner extensions` or `extensions --name <SOURCE_SET>`.
- Infobase changes need to become Git-visible files: check `git status`, then run the relevant `v8-runner dump ...` command.
- Need a CF/CFE package of the state currently stored in the infobase: use
`v8-runner infobase configuration export --state <working|database> --output <file.cf>`;
add `--extension <name>` and use `.cfe` for an extension. This is not `make`, which builds
artifacts from project sources.
- Need a complete portable DT image including data: use `v8-runner infobase dump --output <file.dt>`.
A DT is not a backup. Runner treats `builder` as a provider preference for infobase exports,
skips experimental IBCMD DT, and selects a ready Designer before spawn when available.
- For infobase export failures, distinguish `capability_unavailable` (no implemented adapter)
from `environment_unavailable` (adapter exists, but binary/version/connection is not ready).
Never retry another provider after the selected provider has been spawned.
- Source files need conversion between Designer and EDT: use `v8-runner convert`; this is CLI-only and does not use the infobase.
- Existing `.cf` or `.cfe` artifacts need to be applied to an infobase: use `v8-runner load ...`.
- Release artifacts need to be exported or external artifacts published: use `v8-runner make ...` or the `artifacts` alias.
Expand Down
29 changes: 29 additions & 0 deletions SKILL/references/file-and-artifact-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,35 @@ degrades to incremental.

For `format=EDT`, dump uses an internal Designer snapshot under `workPath/designer/<sourceSetName>`, then imports the result into the EDT target.

## Export From An Infobase

Use configuration export when the artifact must reflect state already stored in the infobase:

```bash
v8-runner infobase configuration export --state working --output dist/main.cf
v8-runner infobase configuration export --state database --output dist/main.cf
v8-runner infobase configuration export --state database --extension Sales --output dist/sales.cfe
```

These commands accept `source-set: []` because project source trees are not inputs. If no config
exists and sources are not requested, create the minimal infobase-only config described by the
skill entrypoint instead of running `bootstrap`.

This differs from `make`: `make` builds from project sources, while this command reads the
working or database configuration from the configured infobase. The configured `builder` sets the
preferred provider; runner may choose a ready alternate during pure preflight, but never after
dispatch.

Use a DT only as a portable full-infobase image, not as a backup:

```bash
v8-runner infobase dump --output dist/base.dt
```

DT export uses the implemented Designer adapter. IBCMD DT remains experimental until a
no-active-connections or exclusive-access preflight is implemented and proved; if Designer is
ready, runner selects it even when `builder=IBCMD`.

## Convert

`convert` is repo-aware file conversion between Designer and EDT source formats.
Expand Down
45 changes: 45 additions & 0 deletions docs/CAPABILITIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ CLI help, доверяйте текущему коду и затем синхр
| `dump` | `format=DESIGNER` + `builder=DESIGNER` | Полная, инкрементальная или object-scoped partial выгрузка |
| `dump` | `format=DESIGNER` + `builder=IBCMD` | Полная и инкрементальная выгрузка; `partial` деградирует в incremental с warning; standalone-server state изолирован в `workPath/ibcmd-data` |
| `dump` | `format=EDT` + `builder=DESIGNER|IBCMD` | Reverse sync из ИБ через internal Designer snapshot и EDT import |
| `infobase configuration export` | Designer и IBCMD | Выгружает working/database configuration в `.cf` или named extension в `.cfe`; `builder` задаёт preferred provider, runner выбирает готовый до spawn |
| `infobase dump` | Designer | Выгружает полную ИБ в переносимый `.dt`; это не backup; IBCMD остаётся experimental до exclusive-access preflight |
| `convert` | CLI-only repo-aware конвертация текущих `source-set` | Не использует `builder` и не требует ИБ |
| `load` | `format=DESIGNER` + `builder=DESIGNER` | Загрузка `.cf` / `.cfe` артефактов в ИБ |
| `make` / `artifacts` | `format=DESIGNER` + `builder=DESIGNER` | Экспорт `.cf` / `.cfe` и публикация `.epf` / `.erf` |
Expand Down Expand Up @@ -276,6 +278,49 @@ v8-runner convert [--source-set <NAME>] [--output <DIR>]
- `--output` задаёт только target root и зеркалит `source-set.path` относительно каталога primary config.
- Публикация остаётся staged full replacement с overlap guardrails.

### `infobase configuration export`

```bash
v8-runner infobase configuration export --state <working|database> --output <FILE.cf>
v8-runner infobase configuration export --state <working|database> --extension <NAME> --output <FILE.cfe>
```

- Сохраняет состояние конфигурации из ИБ, а не собирает пакет из project sources.
- Без `--extension` экспортирует main configuration и требует `.cf`; с extension требует `.cfe`.
- `builder` задаёт preferred provider, но runner выбирает первый `implemented + ready` candidate.
- Fallback допустим только во время pure preflight; после первого spawn provider не переключается.
- Публикация идёт через sibling staging и target-specific lock; `published=true` означает, что
финальный файл уже заменён атомарно.
- Target lock сериализует cooperating запуски runner. Параллельный внешний writer обязан
использовать тот же lock или быть остановлен: path revalidation не является filesystem CAS.
- После аварийного завершения owner lock может остаться на диске. Для совместимости с уже
опубликованными версиями runner такой lock обрабатывается fail-closed: удалять его вручную можно
только при остановленных старых и новых процессах runner.
- `execution.status` использует общий terminal vocabulary runner; он не заменяет `published`,
который отдельно отвечает только за commit финального файла.
- `cancelled`, `timed_out` и `invalid_output` не сводятся к generic failure; ошибки считаются
non-retryable по умолчанию, а provider не переключается после dispatch.

### `infobase dump`

```bash
v8-runner infobase dump --output <FILE.dt>
```

- Сохраняет полную ИБ с данными в переносимый DT-файл. DT не является резервной копией.
- В первом slice implemented provider — Designer. При `builder=IBCMD` runner пропускает
experimental IBCMD DT и выбирает готовый Designer.
- Если implemented provider есть, но binary/version/connection не готовы, возвращается
`environment_unavailable`; `capability_unavailable` означает отсутствие implemented adapter.
- Для файловой ИБ readiness обоих process providers требует существующий файл
`<infobase>/1Cv8.1CD`; один каталог или найденный бинарник не считаются готовой ИБ.
- Selection показывает каждого кандидата через независимые `implementation`, `readiness` и
`evidence`; `argv_tested` не выдаётся за live proof.
- Безопасный IBCMD path требует проверки отсутствия активных сеансов.
- Обе операции требуют существующий `v8project.yaml`, но используют infobase-only validation:
`source-set: []` допустим, а отсутствующие или сломанные project sources не блокируют чтение ИБ.
Build/source/test/EDT/client-MCP настройки для этих команд не валидируются.

### `load`

```bash
Expand Down
25 changes: 19 additions & 6 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ tests:
- Тип: путь
- Обязателен: да

Для обычных project-команд список должен содержать поддерживаемый source-set. Исключение —
`infobase configuration export` и `infobase dump`: они используют только ИБ и принимают
`source-set: []`. Это command-specific validation, а не ослабление `build`, source `dump`,
`convert`, `make` или остальных project workflows.

Корень runtime state:

- `workPath/hash-storages`
Expand All @@ -264,7 +269,8 @@ tests:
- `workPath/edt-workspace`
- `workPath/designer`

Если каталога нет, он создаётся автоматически.
Если каталога нет, он создаётся автоматически при захвате workspace lock. Pure provider
selection для infobase export не создаёт `workPath` и runtime-файлы.

### `execution_timeout`

Expand All @@ -291,9 +297,14 @@ tests:

Ограничения:

- `builder=IBCMD` поддерживает `init`, `build`, `dump`, `extensions`;
- для server connection с `builder=IBCMD` обязательны `infobase.dbms.kind`,
`infobase.dbms.server`, `infobase.dbms.name`;
- `builder=IBCMD` поддерживает `init`, `build`, source `dump` и `extensions`; для infobase
export значение `builder` задаёт preferred provider, после чего runner выбирает первый
`implemented + ready` candidate до spawn;
- IBCMD DT остаётся experimental до реализации exclusive-access preflight, поэтому
`infobase dump` использует готовый Designer, если он доступен;
- для server connection IBCMD-кандидат готов только при наличии `infobase.dbms.kind`,
`infobase.dbms.server`, `infobase.dbms.name`; в infobase export отсутствие этих полей не
блокирует готовый Designer alternate;
- для file connection секция `infobase.dbms` запрещена.

### `infobase`
Expand All @@ -305,8 +316,10 @@ tests:
- Тип: строка
- Обязателен: да

Строка подключения к ИБ. Для file-based ИБ относительный `File=...` резолвится относительно
каталога конфига.
Строка подключения к ИБ. Поддерживается непустой `File=...`, server connection
`Srvr=...;Ref=...` или аргументная форма `/S server\ref`. Для file-based ИБ относительный
`File=...` резолвится относительно каталога конфига. Infobase export не считает произвольную
непустую строку готовым server connection.

#### `infobase.user` / `infobase.password`

Expand Down
4 changes: 4 additions & 0 deletions scripts/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ live-mcp-http.py
### `ci-rust.sh`

- Отвечает только за выбор CI-scope.
- Windows contract scope дополнительно запускает нативный CLI smoke выгрузок CFE и DT через
test-only platform fixture; это сохраняет end-to-end проверку маршрутизации, staging и
публикации на Windows без требования установленной платформы 1С. Тот же scope запускает
cross-process contention smoke и unit-регрессии общего OS/legacy lock protocol.
- Не знает деталей live fixture и не должен дублировать live smoke-логику.

### `ci-happy-path.sh`
Expand Down
11 changes: 8 additions & 3 deletions scripts/test/ci-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ case "$CI_SCOPE" in
contract)
case "$TARGET_OS_LABEL" in
Windows|MINGW*|MSYS*|CYGWIN*)
echo "Windows contract scope runs compile/check smoke plus the detached stdio regression; full cargo test remains Linux-owned until the Windows test suite is hardened."
echo "Windows contract scope runs compile/check smoke, native infobase export CLI smoke, and selected OS regressions; full cargo test remains Linux-owned until the Windows test suite is hardened."
cargo check --locked --all-targets
windows_stdio_tests=(
cargo test --locked --test cli_infobase_cross_platform
cargo test --locked --bin v8-runner 'support::fs::tests::'
windows_contract_tests=(
"platform::process::tests::detached_child_does_not_hold_redirected_stdout_open"
"platform::process::tests::managed_detached_child_does_not_hold_redirected_stdout_open"
"support::path::tests::filesystem_object_identity_changes_when_directory_is_replaced"
"support::fs::tests::replace_file_restores_original_bytes_when_stage_disappeared"
"use_cases::staged_publication::tests::orphan_cleanup_requires_exact_target_kind_and_run_name_contract"
)
listed_tests="$(cargo test --locked -- --list)"
for test_name in "${windows_stdio_tests[@]}"; do
for test_name in "${windows_contract_tests[@]}"; do
if ! grep -Fxq "$test_name: test" <<<"$listed_tests"; then
echo "Windows detached stdio regression is missing: $test_name" >&2
exit 2
Expand Down
6 changes: 4 additions & 2 deletions spec/IMPLEMENTATION_TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ This file tracks open implementation work only.

## Current Status

- Open tasks as of `2026-05-11`: 0.
- Open tasks as of `2026-09-02`: 1.

## Open Tasks

No open implementation tasks.
1. Перевести IBCMD DT provider из `experimental` в `implemented` только после реализации и live
proof проверяемого no-active-connections или exclusive-access preflight; readiness при этом
остаётся отдельной проверкой конкретного окружения.

## Rules

Expand Down
Loading