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
13 changes: 13 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ cannot insert a hook or script between them. See
external-build boundary is qualified only for macOS and Windows; this document
makes no Linux support claim.

Schema 8 keeps that session byte-identical and adds one declaration to the
local `go-v1` command: `modules`, the first-party Go modules of the same package
that the build root replaces. The package states a claim and the manager checks
it against the frozen snapshot before the fixed `go list`, then reconciles it
against the effective replace set read only from `<build root>/vendor/modules.txt`
after `go list` and before `go build`. Nothing else moves: the logical build
input, the cache key, the receipt, and the artifact-relative path are unchanged,
and a schema-8 installation is recorded by install marker v4, which carries
marker-v3 meaning over a schema-8 manifest. `script-worker-v1` is a separate
schema-8 addition this manager does not implement; a command selecting it is
rejected with `script_execution_policy_unsupported` rather than installed
declared-only.

This architecture boundary follows the accepted
[rc.5 protocol core](https://github.com/relux-works/curator-spec/blob/v1.0.0-rc.5/protocol/core.md).
Later protocol revisions are outside this document's scope.
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Добавлено

- Аутентификация приватных HTTPS build-репозиториев через manager credential broker. Скоупы `build_https` в глобальном конфиге хранят источник токена (`git-credentials`, `keyring`, `token_env`), никогда сам токен; та же longest-prefix грамматика канонической идентичности, что у `build_ssh`, применение пер-репо. Сабкоманды `csk config build-https add/login/list/remove`, интерактивный precheck с обнаруженными кандидатами перед первым fetch, run-wide override `CSK_BUILD_HTTPS_TOKEN` (с необязательными `CSK_BUILD_HTTPS_USERNAME` и пином хоста `CSK_BUILD_HTTPS_HOST`; без пина токен уходит каждому HTTPS-хосту замыкания). Креды читает менеджер до fetch через `git credential fill/approve/reject` при отключённых интерактивных запросах; брокер отвечает только на два промпта Git и только для запиненного хоста, любой другой ввод завершается fail-closed. Helper, который молча ничего не сохранил, обнаруживается обратным чтением. Анонимный HTTPS остаётся рабочим транспортом, когда ни один скоуп не совпал.
- Authoring-контракт `agent-skill.json` schema 8 (`csk-skill.json` тоже): опциональный
список `modules` на локальной команде `go-v1` и опциональная пара
`execution_policy` + `interpreter` на script-команде. Схемы 1-7 отклоняют оба
поля и на верхнем уровне, и на каждой команде.
- Declared first-party module roots для `go-v1`: менеджер проверяет объявленные
каталоги модулей по замороженному снапшоту до фиксированного `go list`
(portable relative path, не `.`, уникальность, реальный link-free каталог,
`go.mod` прямо внутри, попарная непересекаемость с другими объявленными
модулями, build roots и runtime roots под точным и platform-path сравнением),
затем после `go list` и до `go build` читает эффективный replace-set только из
`<build root>/vendor/modules.txt`, сверяет selection-аннотации с
unversioned-left директивами, отклоняет версию с любой стороны и
module-to-module redirect и проверяет биекцию в обе стороны. Пакеты
заменённого модуля допускаются ровно на этом множестве, поверхность сканирования
расширена на объявленные каталоги и их vendor-копии, а послабление для
аудированного стороннего vendor-кода к заменённым модулям не применяется.
Диагностики: `build_module_root_declaration_invalid`,
`build_module_root_containment_invalid`,
`build_module_root_directive_form_unsupported`,
`build_module_root_directive_undeclared`,
`build_module_root_declaration_unused`.
- Install marker schema 4: та же форма и та же семантика записей сборки, что и у
marker v3, но описывает установку schema-8. Мутация установки schema 8
записывает marker v4, schema 7 по-прежнему marker v3, схемы 1-6 по-прежнему
marker v2. Читаются marker-схемы 1, 2, 3 и 4.

### Исправлено

- Fail-closed отказ `script_execution_policy_unsupported`: csk не реализует
`script-worker-v1`, поэтому script-команда, выбравшая эту политику,
отклоняется на установке и в `csk check` и никогда не публикуется как
declared-only shim.

### Исправлено

Expand Down
44 changes: 44 additions & 0 deletions LOGBOOK.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Logbook

## 2026-08-24 - TASK-260824-2i5yqw: marker v4 inherits four pre-existing marker-v3 conformance gaps

Marker v4 is marker v3 with a different manifest band, so `InstallMarkerV3` and the new
`InstallMarkerV4` were folded onto one `_InstallMarkerExternalCapable` body in
`src/csk/install_marker.py`. Running the candidate `install-marker-v4` schema cases through
`install_marker.read_install_marker` showed 4 of 27 disagreeing, and running the
`install-marker-v3` cases from both the candidate root and the ref CI pins today
(curator-spec `0c81c1f`) showed the identical 4 of 27. The gaps are pre-existing schema-7
external-repository substitution semantics, not something schema 8 introduced, and marker v4
inherits them exactly because it inherits v3's body.

- `valid-network-substitution-branch`: csk rejects a substitution ref of kind `branch` with
`repository substitution ref kind must be tag or revision`; the corpus expects it valid.
- `invalid-marker-local-identity-kind-mismatch`: a `local-path` substitution against a
`network-git` effective identity is accepted; the corpus expects it rejected.
- `invalid-marker-sha1-effective-revision-width` and its sha256 twin: a substitution revision
whose hex width contradicts `object_format` is accepted; the corpus expects both rejected.

CI does not surface this today. `tests/test_protocol_conformance.py` drives schema cases only for
the names in `IN_SCOPE_SCHEMA_NAMES` (agent-skill-v6, build-receipt-v1, conformance-claim-v1..v3,
csk-skill-v6, install-marker-v2), so no install-marker-v3 case is executed at all. The full suite
with `CURATOR_CONFORMANCE_ROOT` set to the pinned root is green: 2735 passed, 84 skipped, exit 0.

Deliberately left out of the schema-8 branch. Fixing them means changing schema-7 substitution
validation, a different manifest band with its own corpus, and the correct expectations live in the
rc.9 candidate suite that TASK-260824-31y75t consumes. Recorded here so the qualification task picks
it up instead of rediscovering it.

## 2026-08-24 - TASK-260824-2i5yqw: `go list -mod=vendor` reports a replaced module through `Module.Replace` only

Probed a real two-module vendored tree before touching `src/csk/builds/go_v1.py`. For
`replace example.com/board => ../../pkg/board`, `go mod vendor` writes both
`# example.com/board v0.0.0 => ../../pkg/board` (selection) and
`# example.com/board => ../../pkg/board` (the effective directive), which is exactly the
reconciliation Protocol Core 4.2.3 relies on to reject a versioned left side without parsing
`go.mod`.

The `go list` package entry for the replaced module carries `Module.Path`, `Module.Version`, and a
`Module.Replace` object with `Path`, `Dir`, `GoMod`, `GoVersion`, but no top-level `Module.Dir` or
`Module.GoMod`. `Module.Replace.Dir` points outside the build root, into the snapshot. That is why
`_validate_module` keys admission on `Module.Path` against the bijected set rather than on any path
in the stream: the spec forbids treating `Replace.Dir` or `Replace.GoMod` as evidence a path exists,
and under `-mod=vendor` Go does not stat them.

## 2026-08-24 - TASK-260824-2h0vjy EPERM is not a verdict about a process group

`Merge Go E2E / Python 3.14 on macos-latest` rejected an install with
Expand Down
18 changes: 18 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ python -m pip install --user cocoaskills
* Схема v5: добавляет секцию требований к MCP-серверам.
* Схема v6: добавляет компилируемые команды и исключение файлов сборки через `build_roots`.
* Схема v7: добавляет зафиксированные внешние git-репозитории сборки через `go-repository-v1`.
* Схема v8: добавляет объявленные корни first-party модулей `modules` на команде `go-v1` и пару `execution_policy` + `interpreter` на script-команде.

### Пример смешанного манифеста

Expand Down Expand Up @@ -192,6 +193,23 @@ python -m pip install --user cocoaskills

Драйвер `go-v1` использует вендоренные зависимости и отключает сетевой доступ во время сборки. Валидация пакета отвергает смену инструментария, cgo, PGO, кодогенераторы, тесты, ассемблерные файлы и внешнюю линковку.

### Корни first-party модулей схемы v8

Команда `go-v1` схемы v8 объявляет `modules`: каталоги first-party Go-модулей
того же пакета, которые корень сборки заменяет через `replace`. Менеджер
проверяет объявление по снапшоту до фиксированного `go list`, читает
эффективный набор `replace` только из `<корень сборки>/vendor/modules.txt`
после `go list` и до `go build`, допускает лишь форму "каталог" без версий с
обеих сторон и требует взаимно однозначного соответствия объявленных каталогов
и эффективных директив. Объявленные каталоги входят в поверхность сканирования
вместе со своими vendor-копиями; послабление для аудированного стороннего
vendor-кода к заменённым модулям не применяется. Установка схемы v8 записывает
install marker schema 4.

Политику выполнения `script-worker-v1` csk не реализует: script-команда, которая
её выбирает, отклоняется с `script_execution_policy_unsupported` на установке и
в `csk check` и никогда не публикуется как declared-only shim.

Процесс сборки выполняется через изолированный воркер `manager-worker-v1`. Менеджер проверяет идентичность воркера перед выдачей авторизации на сборку. Скомпилированные артефакты сохраняются в защищенном кэше `<csk-home>/builds/go-v1/` и исполняются через сгенерированные shims. Полный контракт сборки, структуру хранения кэша, протокол передачи воркера и границы безопасности см. в разделе [Schema-6 build contract](../ARCHITECTURE.md#schema-6-build-contract).

## SSH-креды внешних репозиториев сборки
Expand Down
67 changes: 67 additions & 0 deletions docs/skill-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,73 @@ build/vendor/ checked-in modules when non-standard packages a
конфиге, описан в `docs/external-build-repositories.md`. `go-repository-v1`
поддерживается только на macOS и Windows.

### Схема v8: корни first-party модулей и политика выполнения script-команд

Схема v8 добавляет два необязательных поля.

Локальная команда `go-v1` объявляет `modules`: список каталогов first-party
Go-модулей того же пакета, которые корень сборки заменяет через `replace`.
Отсутствующий или пустой список сохраняет смысл схем v6 и v7, то есть корень
сборки из одного модуля.

```json
{
"schema_version": 8,
"capabilities": {},
"build_roots": ["tools/cli"],
"commands": {
"cli": {
"type": "build",
"driver": "go-v1",
"source_dir": "tools/cli/cmd/cli",
"modules": ["pkg/board", "pkg/remoteconfig"]
}
}
}
```

Пакет заявляет, менеджер проверяет. Каждый объявленный каталог обязан быть
портируемым относительным путём, отличным от `.`, реальным каталогом без
ссылок внутри снапшота, содержать `go.mod` прямо внутри и не пересекаться ни с
другим объявленным модулем, ни с корнем сборки, ни с runtime-корнем. Проверка
идёт до фиксированного `go list`.

Эффективный набор `replace` менеджер читает только из
`<корень сборки>/vendor/modules.txt` после `go list` и до `go build`.
Допускается лишь форма "каталог": по одному токену с каждой стороны.
Версия слева, версия справа и redirect с модуля на модуль отклоняются.
Объявленные каталоги и эффективные директивы обязаны находиться во взаимно
однозначном соответствии: директива без объявления отклоняется как
`build_module_root_directive_undeclared`, объявление без директивы как
`build_module_root_declaration_unused`.

Объявленные каталоги входят в поверхность сканирования вместе со своими
vendor-копиями, а послабление для аудированного стороннего vendor-кода на
заменённые модули не распространяется.

Script-команда может выбрать закрытую политику выполнения парой
`execution_policy` + `interpreter`:

```json
{
"type": "script",
"unix_path": "scripts/tool",
"execution_policy": "script-worker-v1",
"interpreter": "python3-v1"
}
```

Поля обязательны друг для друга; единственное допустимое значение
`execution_policy` это `script-worker-v1`, допустимые интерпретаторы это
`python3-v1` и `node-v1`. csk не реализует `script-worker-v1`, поэтому
отклоняет такую команду с `script_execution_policy_unsupported` на установке и
в `csk check`. Команда не понижается до declared-only shim: опубликованный
лаунчер выполнял бы код пакета, который манифест объявляет изолированным.

Установка схемы v8 записывает install marker schema 4. Форма и семантика
записей сборки те же, что у marker v3.


## 4. Runtime-корни

Секция `runtime_roots` перечисляет каталоги только для runtime. CocoaSkills копирует их в глобальное хранилище runtime и исключает из установленного контекста промпта.
Expand Down
Loading
Loading