treefmt + samba dir changed
This commit is contained in:
1 parent
d1b1b07903
commit
d6d64d21c3
28 files changed
+996
-1120
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# MetaAgent
|
||||
|
||||
Этот проект использует [MetaAgent](.agent/src/GUIDE.md) v{VERSION} —
|
||||
набор инструкций для AI-агента.
|
||||
|
||||
## Контекст MetaAgent
|
||||
|
||||
| Ресурс | Путь |
|
||||
|--------|------|
|
||||
| Главная инструкция | `.agent/src/GUIDE.md` |
|
||||
| Протоколы фаз | `.agent/src/PROTOCOLS/` |
|
||||
| Команды (on-demand) | `.agent/src/COMMANDS/` |
|
||||
| Шаблоны артефактов | `.agent/src/TEMPLATES/` |
|
||||
| Границы (что разрешено/запрещено) | `.agent/src/BOUNDARIES.md` |
|
||||
| Правила проекта | `.agent/rules/project-rules.md` |
|
||||
| Пример работы | `.agent/src/WORKFLOW.md` |
|
||||
| История версий | `.agent/src/CHANGELOG.md` |
|
||||
| Версия | `.agent/src/VERSION` |
|
||||
|
||||
## Состояние сессии (если инициализировано)
|
||||
|
||||
| Артефакт | Путь |
|
||||
|----------|------|
|
||||
| Чекпоинты сессии | `.agent/checkpoints.json` |
|
||||
| Слепок проекта | `.agent/context/project-state.md` |
|
||||
| Анализ репозитория | `.agent/context/analysis-report.md` |
|
||||
| Дорожная карта | `.agent/roadmap/sources.md` |
|
||||
| Манифест задач | `.agent/tasks/manifest.json` |
|
||||
| Сводка для следующего агента | `.agent/handoff-summary.md` |
|
||||
| Сводка сессии | `.agent/session-summary.md` |
|
||||
| Реестр результатов (pending) | `.agent/requests/active/` |
|
||||
| Реестр результатов (archive) | `.agent/requests/archive/` |
|
||||
| ADR | `.agent/decisions/` |
|
||||
|
||||
## Для агента
|
||||
|
||||
Жизненный цикл MetaAgent v3.0:
|
||||
|
||||
```
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
```
|
||||
|
||||
1. **Прочитай** `.agent/src/GUIDE.md` — пойми цикл и доступные команды.
|
||||
2. **Прочитай** `.agent/src/BOUNDARIES.md` — соблюдай границы.
|
||||
3. **Прочитай** `.agent/rules/project-rules.md` — выполни правила пользователя.
|
||||
4. **Проверь** `.agent/checkpoints.json` — если существует, используй как состояние сессии.
|
||||
5. **Проверь** `.agent/context/project-state.md` — получи актуальную картину.
|
||||
6. **Проверь** `.agent/tasks/manifest.json` — если существует, выполняй задачи по порядку.
|
||||
7. **Проверь** `.agent/requests/active/` — если есть незакрытые request-ы, начни с METASTATE.
|
||||
8. Если `.agent/` не инициализирован или устарел — запусти `bash install.sh --update` (Unix или Git-Bash на Windows).
|
||||
|
||||
## Команды
|
||||
|
||||
В любой момент пользователь может вызвать:
|
||||
|
||||
- `/adr` — записать архитектурное решение (см. `.agent/src/COMMANDS/adr.md`)
|
||||
- `/red-team` — попытаться сломать дизайн (см. `.agent/src/COMMANDS/red-team.md`)
|
||||
- `/risk-register` — зафиксировать допущения (см. `.agent/src/COMMANDS/risk-register.md`)
|
||||
- `/alt-arch` — описать альтернативу (см. `.agent/src/COMMANDS/alt-arch.md`)
|
||||
- `/invariant-tests` — тесты-инварианты для ADR (см. `.agent/src/COMMANDS/invariant-tests.md`)
|
||||
|
||||
Команды выполняются **только по явной просьбе**. Не вызываются автоматически.
|
||||
@@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## Удаление PowerShell-установщика
|
||||
|
||||
**Дата:** 2026-11-06
|
||||
|
||||
`install.ps1` удалён из кита. Установщик теперь один — `install.sh` (Unix и Git-Bash на Windows); `install.bat` был удалён раньше.
|
||||
|
||||
**Почему:** второй установщик — это второй список файлов, который расходится с `KIT-MANIFEST.tsv` молча, и вторая реализация того, что уже написано один раз. Красная линия репозитория (`AGENTS.md`) прямо запрещает PowerShell как вторую реализацию. Обновление кита на Windows-хосте — `bash install.sh --update` из Git-Bash.
|
||||
|
||||
**Историческая запись ниже не переписана:** на момент v3.0.0 `install.ps1 -Update` действительно был способом обновиться, и в разделе «Миграция с v2.1 → v3.0» он упомянут как факт того времени.
|
||||
|
||||
## 3.0.0 — Упрощение модели
|
||||
|
||||
**Дата:** 2026-10-08
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# NNN: Краткое название фичи
|
||||
|
||||
## Проблема
|
||||
|
||||
Что именно не устраивает в текущей версии MetaAgent? Почему это важно?
|
||||
|
||||
## Идея
|
||||
|
||||
Основная концепция решения. 2-5 предложений, не углубляясь в детали.
|
||||
|
||||
## Ключевые компоненты
|
||||
|
||||
- Что нового появляется (фазы, протоколы, директории, роли)
|
||||
- Что меняется в существующем
|
||||
|
||||
## Открытые вопросы
|
||||
|
||||
- Что пока не решено?
|
||||
- Какие есть альтернативы?
|
||||
- Где узкие места?
|
||||
|
||||
## Зависимости
|
||||
|
||||
- Какие другие фичи/изменения нужны перед этой
|
||||
@@ -0,0 +1,128 @@
|
||||
# 010: OMO Integration — MetaAgent как слой метаданных проекта
|
||||
|
||||
## Статус: черновик (планирование)
|
||||
|
||||
## Проблема
|
||||
|
||||
MetaAgent v3.0 имеет структурированный `.agent/` с правилами, решениями, задачами, контекстом и командами on-demand. Но нет исполняющего движка, который гарантированно читает эти артефакты перед работой. OMO (oh-my-opencode) — идеальный движок, но его состояние живёт только локально в `.omo/`.
|
||||
|
||||
## Идея
|
||||
|
||||
`.agent/` — канонический слой метаданных проекта (коммитится в репозиторий).
|
||||
`.omo/` — операционный слой (только локально, сессии, планы выполнения).
|
||||
|
||||
OMO читает `.agent/` перед работой, пишет в `.agent/` после работы.
|
||||
|
||||
## Разделение ответственности
|
||||
|
||||
| Аспект | `.agent/` (MetaAgent) | `.omo/` (OMO) |
|
||||
|--------|----------------------|----------------|
|
||||
| Persistence | Коммитится в репозиторий | Только локально |
|
||||
| Содержимое | Rules, ADRs, task manifest, контекст, requests, roadmap | Boulder, планы, кэш сессий |
|
||||
| Аудитория | Любой AI-агент (Claude, GPT, OMO) | Только OMO |
|
||||
| Время жизни | Всё время проекта | Сессия |
|
||||
|
||||
## Интеграционные точки
|
||||
|
||||
### 1. Pre-execution Hook (самое важное)
|
||||
|
||||
Перед тем как Sisyphus начинает работу:
|
||||
1. Проверить `.agent/rules/project-rules.md`
|
||||
2. Если есть — прочитать, добавить в system prompt как constraints
|
||||
3. Проверить `.agent/decisions/index.json`
|
||||
4. Если есть релевантные ADR — добавить как context
|
||||
5. Проверить `.agent/tasks/manifest.json`
|
||||
6. Если есть pending задачи — предложить их перед новыми
|
||||
7. Проверить `.agent/context/project-state.md` — актуальный слепок
|
||||
8. Проверить `.agent/requests/active/` — если есть ready_for_review, предложить METASTATE
|
||||
|
||||
### 2. Todo-манифест sync
|
||||
|
||||
OMO todowrite ↔ `.agent/tasks/manifest.json`:
|
||||
|
||||
- **PUSH**: задача завершена OMO → обновить `.agent/tasks/manifest.json` (status: completed) + создать request
|
||||
- **PULL**: OMO стартует → прочитать `.agent/tasks/manifest.json`
|
||||
- Конфликты: `last_updated` — кто позже, тот прав
|
||||
|
||||
### 3. ADR Creation Hook
|
||||
|
||||
После архитектурного решения от Oracle:
|
||||
1. Oracle выдал рекомендацию
|
||||
2. OMO: "Записать как ADR?" (вызов команды `/adr`)
|
||||
3. При подтверждении — `.agent/decisions/NNN-slug.md` + обновить `index.json`
|
||||
|
||||
### 4. Skill: agent-metadata
|
||||
|
||||
Новый OMO skill, дающий агенту инструкции по работе с `.agent/`:
|
||||
|
||||
```
|
||||
load_skills=["agent-metadata"]
|
||||
```
|
||||
|
||||
Skill содержит:
|
||||
- Структуру `.agent/` и обязательные поля
|
||||
- Цикл фаз (INIT → ANALYSE → ROADMAP → DESIGN → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF)
|
||||
- Команды on-demand (adr, red-team, risk-register, alt-arch, invariant-tests)
|
||||
- Правила валидации
|
||||
- Шаблоны
|
||||
|
||||
### 5. Checkpoint Integration
|
||||
|
||||
При старте сессии OMO читает `.agent/checkpoints.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"metaagent_version": "3.0.0",
|
||||
"session_id": "ses_...",
|
||||
"goal": "...",
|
||||
"project_type": "existing | greenfield | scaffold",
|
||||
"phases": { ... },
|
||||
"last_task_id": "T3",
|
||||
"context_hashes": {
|
||||
"rules": "sha256_of_rules",
|
||||
"decisions": "sha256_of_decisions_index"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`context_hashes` — если rules изменились с прошлой сессии → OMO перечитывает.
|
||||
|
||||
## Протоколы: OMO-aware vs Standalone
|
||||
|
||||
| Фаза | OMO-режим | Standalone-режим |
|
||||
|------|-----------|-------------------|
|
||||
| INIT | OMO создаёт `.agent/` | install.sh/ps1 |
|
||||
| ANALYSE | explore + librarian → `.agent/context/` | Агент сам сканирует |
|
||||
| DESIGN | Oracle пишет design-report, пользователь вызывает /adr | Агент пишет design-report |
|
||||
| DECOMPOSITION | todowrite sync → `.agent/tasks/manifest.json` | Ручное создание |
|
||||
| EXECUTION | OMO build/test/commit + request | То же |
|
||||
| METASTATE | OMO: ревью requests → архивация → handoff-summary | Агент вручную |
|
||||
| HANDOFF | `.agent/checkpoints.json` финализируется | То же |
|
||||
|
||||
## Что не меняется
|
||||
|
||||
- BOUNDARIES.md — концепция валидна
|
||||
- Архивация (HANDOFF) — остаётся
|
||||
- **Depth scale убрана в v3.0** — больше нет порогов depth для команд. Команды вызываются явно.
|
||||
- Разделение meta/exec — OMO берёт обе роли (Sisyphus как meta, deep/quick как exec)
|
||||
- Команды (`/adr`, `/red-team`, ...) — загружаются как skills, доступны OMO по явному вызову
|
||||
|
||||
## FUTURE планы MetaAgent в контексте OMO
|
||||
|
||||
- FUTURE/001 (multi-agent workers) — OMO уже умеет делегировать (explore, librarian, oracle)
|
||||
- FUTURE/002 (coordination server) — не нужен, MCP + background tasks заменяют
|
||||
- FUTURE/003 (.temp/) — уже частично в MetaAgent, доинтегрировать
|
||||
|
||||
## Открытые вопросы
|
||||
|
||||
- Как часто OMO должен синхронизировать `.agent/tasks/manifest.json`?
|
||||
- Нужна ли JSON Schema валидация при записи в `.agent/`?
|
||||
- Как быть если `.agent/rules/project-rules.md` конфликтует с OMO system prompt?
|
||||
- Стоит ли делать двухсторонний sync или только OMO → .agent?
|
||||
- Как обрабатывать parallel writes от нескольких OMO-сессий?
|
||||
|
||||
## Зависимости
|
||||
|
||||
- MetaAgent v3.0 (текущая версия, упрощённая модель: цикл + команды)
|
||||
- OMO с поддержкой pre-execution hooks
|
||||
- Skill system для agent-metadata
|
||||
+1
-1
@@ -109,7 +109,7 @@ MetaAgent — набор инструкций для AI-агента. Задач
|
||||
COMMANDS/
|
||||
TEMPLATES/
|
||||
VERSION
|
||||
install.sh / install.ps1
|
||||
install.sh
|
||||
|
||||
rules/
|
||||
project-rules.md # ваши правила — читать перед каждой фазой
|
||||
|
||||
+103
-21
@@ -2,21 +2,40 @@
|
||||
|
||||
## Цель
|
||||
|
||||
Подготовить `.agent/` в целевом репозитории: установить исходники MetaAgent, создать структуру директорий, инициализировать `checkpoints.json`, создать/обновить `AGENTS.md`.
|
||||
Подготовить `.agent/` в целевом репозитории: установить исходники MetaAgent,
|
||||
создать структуру директорий, создать `checkpoints.json`,
|
||||
`rules/project-rules.md`, `decisions/index.json`, `.temp/` с записью в
|
||||
`.gitignore`, и `AGENTS.md`.
|
||||
|
||||
INIT выполняется **один раз** в начале работы с проектом. Если `.agent/` уже существует и инициализирован — пропускается.
|
||||
INIT выполняется **один раз** в начале работы с проектом. Если `.agent/` уже
|
||||
существует и инициализирован — пропускается.
|
||||
|
||||
**Весь INIT выполняет `install.sh`** — единственный установщик кита. Этот
|
||||
протокол описывает ровно то, что делает скрипт; тест
|
||||
`tests/sh-framework-install-init.sh` проверяет соответствие, и расхождение
|
||||
между этим файлом и скриптом — дефект, а не «примерно то же».
|
||||
|
||||
**Два правила записи, и они разные:**
|
||||
|
||||
| Что | Правило |
|
||||
|---|---|
|
||||
| `.agent/src/` — копия кита | перезаписывается **только** с `--update` |
|
||||
| `checkpoints.json`, `rules/project-rules.md`, `decisions/index.json`, `.gitignore`, `AGENTS.md` | **данные проекта**: пишутся, только если файла нет; не перезаписываются **никогда** — ни на первом прогоне, ни с `--update` |
|
||||
|
||||
## Вход
|
||||
|
||||
- Целевой репозиторий (путь или текущая директория)
|
||||
- `VERSION` — текущая версия MetaAgent
|
||||
- `VERSION` — версия MetaAgent в форме `MAJOR.MINOR.PATCH`. Другая форма —
|
||||
отказ установщика (exit 1): `VERSION` попадает в `checkpoints.json`, а
|
||||
`TEMPLATES/schemas/checkpoints-schema.json` требует именно эту форму
|
||||
- Опционально: существующий `.agent/` (если обновление)
|
||||
|
||||
## Шаги
|
||||
|
||||
### 0.1. Определить целевой репозиторий
|
||||
|
||||
Если не указан явно — текущая рабочая директория. Если указан как URL — клонировать во временную директорию, дальше работать с копией.
|
||||
Если не указан явно — текущая рабочая директория. Если указан как URL —
|
||||
клонировать во временную директорию, дальше работать с копией.
|
||||
|
||||
### 0.2. Проверить существующий `.agent/`
|
||||
|
||||
@@ -24,14 +43,18 @@ INIT выполняется **один раз** в начале работы с
|
||||
|
||||
- Прочитать `.agent/checkpoints.json` → `metaagent_version`
|
||||
- Если `metaagent_version == VERSION` → INIT уже выполнен, выйти
|
||||
- Если версия старше → запустить `install.sh --update` (Unix) или `install.ps1 -Update` (Windows) для переустановки исходников, затем выйти
|
||||
- Если `.agent/` есть, но `checkpoints.json` отсутствует → продолжить INIT (создать checkpoints)
|
||||
- Если версия старше → запустить `bash install.sh --update` (Unix или Git-Bash
|
||||
на Windows), затем выйти. `--update` переустанавливает `.agent/src/` **и
|
||||
создаёт отсутствующие INIT-артефакты**; существующие он не трогает, поэтому
|
||||
на проекте, инициализированном раньше, он дописывает ровно недостающее
|
||||
- Если `.agent/` есть, но `checkpoints.json` отсутствует → продолжить INIT
|
||||
(создать checkpoints)
|
||||
|
||||
Если `.agent/` не существует → продолжить INIT.
|
||||
|
||||
### 0.3. Создать структуру `.agent/`
|
||||
|
||||
Создать директории:
|
||||
Создать директории (ровно этот набор; лишних нет, пропущенных нет):
|
||||
|
||||
```
|
||||
.agent/
|
||||
@@ -51,40 +74,69 @@ INIT выполняется **один раз** в начале работы с
|
||||
decisions/
|
||||
requests/
|
||||
checkpoints/
|
||||
.temp/ # в корне проекта, не внутри .agent/
|
||||
```
|
||||
|
||||
### 0.4. Создать `.temp/` в корне проекта
|
||||
### 0.4. Создать `.temp/` и записать его в `.gitignore`
|
||||
|
||||
Если не существует — создать `.temp/` в корне целевого репозитория. Добавить в `.gitignore` (если его нет — создать с одной строкой `.temp/`).
|
||||
Если `.temp/` не существует — создать `.temp/` в корне целевого репозитория.
|
||||
|
||||
Добавить в `.gitignore` строку `.temp/`:
|
||||
|
||||
- `.gitignore` нет → создать с одной строкой `.temp/`
|
||||
- строка уже есть → **ничего не делать** (файл не переписывается; второй
|
||||
прогон установщика не меняет в нём ни байта)
|
||||
- строки нет → **дописать** в конец, сохранив все существующие строки как
|
||||
есть. Проверка «уже есть» сравнивает строки без `\r`: `.gitignore` с CRLF
|
||||
иначе выглядит так, будто `.temp/` в нём нет (см. `AGENTS.md`, ловушка 2), и
|
||||
установщик дописывал бы дубликат на каждом прогоне
|
||||
|
||||
### 0.5. Скопировать исходники MetaAgent
|
||||
|
||||
Скопировать в `.agent/src/`:
|
||||
Скопировать в `.agent/src/` — это **ровно набор `KIT-MANIFEST.tsv`, файл в
|
||||
файл** (38 файлов):
|
||||
|
||||
- `GUIDE.md`
|
||||
- `BOUNDARIES.md`
|
||||
- `CHANGELOG.md`
|
||||
- `WORKFLOW.md`
|
||||
- `README.md`
|
||||
- `AGENTS.template.md`
|
||||
- `VERSION`
|
||||
- `PROTOCOLS/`
|
||||
- `COMMANDS/`
|
||||
- `TEMPLATES/`
|
||||
- `install.sh`, `install.ps1`
|
||||
- `FUTURE/`
|
||||
- `install.sh`
|
||||
|
||||
Существующие файлы в `.agent/src/` не перезаписывать (только с явным `--update`).
|
||||
Существующие файлы в `.agent/src/` не перезаписывать (только с явным
|
||||
`--update`).
|
||||
|
||||
### 0.6. Создать `.agent/rules/project-rules.md`
|
||||
|
||||
Если файла нет — создать по шаблону `TEMPLATES/project-rules.md`.
|
||||
Если файла нет — создать копией `TEMPLATES/project-rules.md`. Существующий
|
||||
файл не трогать: это правила пользователя.
|
||||
|
||||
### 0.7. Создать/обновить `AGENTS.md` в корне
|
||||
### 0.7. Создать `.agent/decisions/index.json`
|
||||
|
||||
Если `AGENTS.md` в корне проекта отсутствует — создать по `AGENTS.template.md` с подставленной версией.
|
||||
Если файла нет — создать реестр ADR в форме
|
||||
`TEMPLATES/schemas/decisions-index-schema.json`:
|
||||
|
||||
Если существует и не относится к MetaAgent — не трогать (попросить пользователя переименовать или подтвердить перезапись).
|
||||
```json
|
||||
{
|
||||
"version": "3.0",
|
||||
"decisions": []
|
||||
}
|
||||
```
|
||||
|
||||
`version` — из перечня схемы (`"2.0"` | `"3.0"`), `decisions` — список; на
|
||||
старте он пуст. `created_at`/`updated_at` схема допускает, но не требует:
|
||||
пустому реестру нечего датировать, а лишняя метка времени сделала бы файл
|
||||
другим на каждом прогоне.
|
||||
|
||||
### 0.8. Инициализировать `checkpoints.json`
|
||||
|
||||
Создать `.agent/checkpoints.json`:
|
||||
Если файла нет — создать `.agent/checkpoints.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -108,21 +160,51 @@ INIT выполняется **один раз** в начале работы с
|
||||
}
|
||||
```
|
||||
|
||||
Поля `goal` и `project_type` остаются `null` до фазы ANALYSE (goal может быть задан пользователем заранее — тогда заполнить сразу).
|
||||
Файл обязан удовлетворять `TEMPLATES/schemas/checkpoints-schema.json`: восемь
|
||||
фаз из перечня `phases`, статусы из перечня
|
||||
`pending | in_progress | completed | failed | skipped`, `metaagent_version` в
|
||||
форме `MAJOR.MINOR.PATCH`, и **ни одного ключа, которого схема не объявляет**.
|
||||
|
||||
`metaagent_version` — из `VERSION`; `session_id` — UUID; `target_repo` —
|
||||
абсолютный путь цели; `last_updated` — ISO 8601 UTC.
|
||||
|
||||
Собственный `.agent/checkpoints.json` этого репозитория **не является
|
||||
образцом**: в нём статусы вида `"completed (2026-10-27: ...)"`, то есть
|
||||
свободный текст, и схеме он не удовлетворяет. Образец — схема + литерал выше.
|
||||
|
||||
Поля `goal` и `project_type` остаются `null` до фазы ANALYSE (goal может быть
|
||||
задан пользователем заранее — тогда заполнить сразу).
|
||||
|
||||
### 0.9. Создать `AGENTS.md` в корне
|
||||
|
||||
Если `AGENTS.md` в корне проекта отсутствует — создать его из
|
||||
`AGENTS.template.md`, подставив `{VERSION}` (единственный плейсхолдер
|
||||
шаблона). Шаблон — **единственное** описание того, что написано в
|
||||
`AGENTS.md`; второй копии текста в установщике нет.
|
||||
|
||||
Если `AGENTS.md` существует — **не перезаписывать никогда**, ни на первом
|
||||
прогоне, ни с `--update`, и не спрашивать подтверждения. Файл может быть
|
||||
собственным файлом владельца или файлом более старого MetaAgent с локальными
|
||||
правками; установщик не умеет их различать, а перезапись необратима. Владелец
|
||||
решает сам, заменить его или дописать.
|
||||
|
||||
## Выход
|
||||
|
||||
- `.agent/` с полной структурой
|
||||
- `.agent/src/` с актуальными исходниками MetaAgent
|
||||
- `.agent/rules/project-rules.md`
|
||||
- `.agent/decisions/index.json`
|
||||
- `.agent/checkpoints.json` со `session_id` и `phases.init = "completed"`
|
||||
- `AGENTS.md` в корне проекта
|
||||
- `.temp/` в корне + `.gitignore` обновлён
|
||||
- `.temp/` в корне + `.gitignore` с `.temp/`
|
||||
|
||||
## Критерии завершения
|
||||
|
||||
- [ ] `.agent/` содержит все обязательные директории
|
||||
- [ ] `.agent/src/` содержит GUIDE.md, PROTOCOLS/, COMMANDS/, TEMPLATES/, VERSION
|
||||
- [ ] `.agent/checkpoints.json` валиден (JSON parse)
|
||||
- [ ] `.agent/rules/project-rules.md` существует
|
||||
- [ ] `.agent/decisions/index.json` разбирается как JSON и удовлетворяет своей схеме
|
||||
- [ ] `.agent/checkpoints.json` разбирается как JSON и удовлетворяет `checkpoints-schema.json`
|
||||
- [ ] `AGENTS.md` присутствует в корне
|
||||
- [ ] `.temp/` существует и в `.gitignore`
|
||||
- [ ] `.temp/` существует и `.gitignore` содержит `.temp/`
|
||||
- [ ] второй прогон установщика не меняет ни одного файла (идемпотентность)
|
||||
@@ -0,0 +1,193 @@
|
||||
# MetaAgent
|
||||
|
||||
MetaAgent — набор инструкций для AI-агента. Превращает хаотичное общение с агентом в структурированный процесс, в котором состояние проекта переживает любую сессию.
|
||||
|
||||
## Модель v3.0: цикл + команды
|
||||
|
||||
**Цикл** — последовательность фаз, которую агент проходит при работе с проектом:
|
||||
|
||||
```
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
```
|
||||
|
||||
DESIGN выполняется только для greenfield/scaffold-проектов. Для existing — пропускается.
|
||||
|
||||
**Команды** — on-demand инструкции, которые вызываются по явной просьбе пользователя:
|
||||
|
||||
| Команда | Что делает |
|
||||
|---|---|
|
||||
| `/adr` | Записать архитектурное решение в `.agent/decisions/` |
|
||||
| `/red-team` | Попытаться сломать дизайн → `.agent/context/red-team-report.md` |
|
||||
| `/risk-register` | Реестр допущений → `.agent/context/risk-register.md` |
|
||||
| `/alt-arch` | Описать альтернативную архитектуру |
|
||||
| `/invariant-tests` | Тесты-инварианты для ADR |
|
||||
|
||||
Команды **не обязательны**. Если не вызваны — не выполняются. Цикл работает без них.
|
||||
|
||||
## Что отличает MetaAgent от обычного общения с агентом
|
||||
|
||||
| Обычный агент | MetaAgent v3.0 |
|
||||
|---|---|
|
||||
| Контекст теряется при каждом новом разговоре | `.agent/` — полный слепок проекта: состояния, решения, задачи, результаты |
|
||||
| Нет системы — агент действует ad-hoc | Чёткий жизненный цикл: INIT → … → HANDOFF |
|
||||
| Нет места для ваших правил | `.agent/rules/project-rules.md` — читается перед каждой фазой |
|
||||
| Результаты теряются между сессиями | **Request** — документированный результат каждой задачи (summary + коммиты + верификация) |
|
||||
| Архитектурные решения не фиксируются | ADR, Risk Register, Red Team Review — по вызову пользователя |
|
||||
| Контекст бесконтрольно растёт | Завершённые задачи архивируются, `.agent/` остаётся lean |
|
||||
| Сложная конфигурация сессии (depth, фичи) | Никакой конфигурации. Цикл + команды — всё |
|
||||
|
||||
## Ключевые фичи v3.0
|
||||
|
||||
- **Цикл без конфигурации** — никакой шкалы depth, никаких интервью. Агент сам определяет тип проекта в ANALYSE.
|
||||
- **Команды отдельно от цикла** — ADR, Red Team, Risk Register вызываются тогда, когда нужны.
|
||||
- **Request как единица результата** — каждая задача завершается request-ом с diff-summary, коммитами и верификацией.
|
||||
- **METASTATE** — по команде «обнови метасостояние»: ревью requests, обновление слепка проекта, подготовка `.agent/` для следующего агента.
|
||||
- **Project State** — динамический слепок, обновляется при METASTATE. Следующий агент читает `.agent/` и не лезет в исходники.
|
||||
- **Origin задач** — каждая задача знает, откуда пришла (roadmap, ADR, user, agent, decomposition).
|
||||
- **Чекпоинты** (`checkpoints.json`) — позволяют возобновить сессию с любой фазы.
|
||||
- **Ваши правила** — `.agent/rules/project-rules.md` — условия, которые агент соблюдает всегда.
|
||||
- **Одна установка на всех** — `install.sh` (Unix и Git-Bash на Windows). PowerShell-версии нет намеренно: второй установщик — это второй список файлов, который молча расходится с `KIT-MANIFEST.tsv`.
|
||||
|
||||
## Быстрый старт
|
||||
|
||||
```bash
|
||||
# Установить MetaAgent в ваш проект
|
||||
./install.sh /path/to/your/project
|
||||
|
||||
# Или интерактивно:
|
||||
./install.sh
|
||||
```
|
||||
|
||||
Установка — это **весь INIT**, а не только копия исходников. После неё в
|
||||
проекте есть:
|
||||
|
||||
| Что | Откуда |
|
||||
|---|---|
|
||||
| `.agent/src/` | кит, файл в файл по `KIT-MANIFEST.tsv` |
|
||||
| `.agent/checkpoints.json` | литерал `PROTOCOLS/00_INIT.md` §0.8, по `TEMPLATES/schemas/checkpoints-schema.json` (`phases.init = completed`) |
|
||||
| `.agent/rules/project-rules.md` | `TEMPLATES/project-rules.md` |
|
||||
| `.agent/decisions/index.json` | пустой реестр ADR, по `TEMPLATES/schemas/decisions-index-schema.json` |
|
||||
| `.temp/` + строка `.temp/` в `.gitignore` | — |
|
||||
| `AGENTS.md` | `AGENTS.template.md` с подставленным `{VERSION}` |
|
||||
|
||||
Этого достаточно, чтобы цикл начался: протоколы читают `checkpoints.json`,
|
||||
чтобы решить, может ли фаза выполняться. Директор для этого не нужен — ни
|
||||
агенту, ни человеку.
|
||||
|
||||
**Что установщик не перезаписывает.** `checkpoints.json`, `rules/project-rules.md`,
|
||||
`decisions/index.json`, `.gitignore` и `AGENTS.md` — данные проекта. Они
|
||||
пишутся, только если файла нет, и не перезаписываются никогда, **ни на первом
|
||||
прогоне, ни с `--update`**: `--update` — это «обнови `.agent/src/`», а не
|
||||
«снеси моё состояние». Поэтому второй прогон установщика не меняет ни одного
|
||||
файла (идемпотентность), а `AGENTS.md`, который уже лежит в проекте, остаётся
|
||||
байт в байт — даже если он не про MetaAgent.
|
||||
|
||||
Любой AI-агент, работающий в проекте, автоматически получит полный контекст
|
||||
через `AGENTS.md`.
|
||||
|
||||
### Установка на Windows
|
||||
|
||||
Отдельного PowerShell-установщика нет: `install.ps1` удалён 2026-11-06. Причина та же, что и у красной линии репозитория (PowerShell — не вторая реализация): второй установщик — это второй список файлов, который расходится с `KIT-MANIFEST.tsv` молча.
|
||||
|
||||
Windows-хост ставит кит из **Git-Bash** — он и так требуется всему парку (`~/.bashrc`-лаунчеры, `ssh`, `.metaagent`):
|
||||
|
||||
```bash
|
||||
bash framework/install.sh /path/to/project # первая установка
|
||||
bash framework/install.sh --update /path/to/project # обновить .agent/src/
|
||||
```
|
||||
|
||||
Хост **без Git-Bash** (голый Windows без git) поддерживаемого пути не имеет. Ему придётся либо поставить Git for Windows и работать из Git-Bash, либо скопировать содержимое `framework/` в `<project>/.agent/src/` вручную — без `KIT-MANIFEST.tsv`, который описывает кит, а не является его частью, — и создать вручную всё остальное, что делает INIT: `.agent/rules/project-rules.md`, `.agent/checkpoints.json` (литерал `PROTOCOLS/00_INIT.md` §0.8), `.agent/decisions/index.json`, `.temp/` со строкой в `.gitignore` и `AGENTS.md` по `AGENTS.template.md`. Это ручной обход, а не второй установщик: `install.sh` остаётся единственным установщиком.
|
||||
|
||||
## Версия
|
||||
|
||||
Текущая: **3.0.0** (см. `CHANGELOG.md`)
|
||||
|
||||
---
|
||||
|
||||
## MetaAgent (English)
|
||||
|
||||
MetaAgent is an instruction set for an AI agent that transforms chaotic agent interactions into a structured, predictable, and self-contained process.
|
||||
|
||||
### v3.0 model: loop + commands
|
||||
|
||||
**Loop** — the phases an agent goes through when working on a project:
|
||||
|
||||
```
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
```
|
||||
|
||||
DESIGN runs only for greenfield/scaffold projects. For existing — skipped.
|
||||
|
||||
**Commands** — on-demand instructions, invoked by the user explicitly:
|
||||
|
||||
| Command | What it does |
|
||||
|---|---|
|
||||
| `/adr` | Write an architecture decision to `.agent/decisions/` |
|
||||
| `/red-team` | Try to break the design → `.agent/context/red-team-report.md` |
|
||||
| `/risk-register` | Assumptions registry → `.agent/context/risk-register.md` |
|
||||
| `/alt-arch` | Describe an alternative architecture |
|
||||
| `/invariant-tests` | Invariant tests for an ADR |
|
||||
|
||||
Commands are **optional**. If not invoked — not executed. The loop works without them.
|
||||
|
||||
### Why MetaAgent over plain agent chat
|
||||
|
||||
| Plain agent | MetaAgent v3.0 |
|
||||
|---|---|
|
||||
| Context lost with every new conversation | `.agent/` — full project snapshot: state, decisions, tasks, results |
|
||||
| No system — agent acts ad-hoc | Clear lifecycle: INIT → … → HANDOFF |
|
||||
| No place for your rules | `.agent/rules/project-rules.md` — read before every phase |
|
||||
| Results lost between sessions | **Request** — documented result per task (summary + commits + verification) |
|
||||
| Architectural decisions lost | ADR, Risk Register, Red Team Review — invoked on demand |
|
||||
| Context grows unboundedly | Completed tasks are archived, `.agent/` stays lean |
|
||||
| Complex session configuration (depth, features) | No configuration. Loop + commands — that's it |
|
||||
|
||||
### Quick start
|
||||
|
||||
```bash
|
||||
# Install MetaAgent into your project
|
||||
./install.sh /path/to/your/project
|
||||
|
||||
# Or interactive:
|
||||
./install.sh
|
||||
```
|
||||
|
||||
An install is the **whole INIT**, not just a copy of the sources. Afterwards the
|
||||
project has:
|
||||
|
||||
| What | From |
|
||||
|---|---|
|
||||
| `.agent/src/` | the kit, file for file per `KIT-MANIFEST.tsv` |
|
||||
| `.agent/checkpoints.json` | the `PROTOCOLS/00_INIT.md` §0.8 literal, per `TEMPLATES/schemas/checkpoints-schema.json` (`phases.init = completed`) |
|
||||
| `.agent/rules/project-rules.md` | `TEMPLATES/project-rules.md` |
|
||||
| `.agent/decisions/index.json` | an empty ADR index, per `TEMPLATES/schemas/decisions-index-schema.json` |
|
||||
| `.temp/` + a `.temp/` line in `.gitignore` | — |
|
||||
| `AGENTS.md` | `AGENTS.template.md` with `{VERSION}` substituted |
|
||||
|
||||
That is enough for the loop to start: the protocols read `checkpoints.json` to
|
||||
decide whether a phase may run. No director is needed for that — neither by an
|
||||
agent nor by a human.
|
||||
|
||||
**What the installer never overwrites.** `checkpoints.json`,
|
||||
`rules/project-rules.md`, `decisions/index.json`, `.gitignore` and `AGENTS.md`
|
||||
are the project's data. They are written only when absent and are never
|
||||
overwritten, **neither on a first run nor with `--update`**: `--update` means
|
||||
"refresh `.agent/src/`", not "wipe my state". So a second run changes no file at
|
||||
all (idempotent), and an `AGENTS.md` that already exists stays byte-identical —
|
||||
even when it is not about MetaAgent.
|
||||
|
||||
Any AI agent working in the project automatically gets full context through
|
||||
`AGENTS.md`.
|
||||
|
||||
### Installing on Windows
|
||||
|
||||
There is no PowerShell installer: `install.ps1` was removed on 2026-11-06. A second installer is a second file list that silently drifts from `KIT-MANIFEST.tsv` — and the repo's red line says PowerShell is never a second implementation.
|
||||
|
||||
A Windows host installs the kit from **Git-Bash**, which the fleet already requires (`~/.bashrc` launchers, `ssh`, `.metaagent`):
|
||||
|
||||
```bash
|
||||
bash framework/install.sh /path/to/project # first install
|
||||
bash framework/install.sh --update /path/to/project # refresh .agent/src/
|
||||
```
|
||||
|
||||
A host **without Git-Bash** has no supported path: either install Git for Windows and use Git-Bash, or copy the contents of `framework/` into `<project>/.agent/src/` by hand — without `KIT-MANIFEST.tsv`, which describes the kit rather than being part of it — and create the rest of INIT by hand: `.agent/rules/project-rules.md`, `.agent/checkpoints.json` (the `PROTOCOLS/00_INIT.md` §0.8 literal), `.agent/decisions/index.json`, `.temp/` with its line in `.gitignore`, and `AGENTS.md` from `AGENTS.template.md`. That is a manual workaround, not a second installer: `install.sh` stays the only one.
|
||||
@@ -19,108 +19,25 @@
|
||||
"description": "Path to the target repository"
|
||||
},
|
||||
"goal": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"type": ["string", "null"],
|
||||
"description": "Session goal (set by user, may be null until first task)"
|
||||
},
|
||||
"project_type": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
null,
|
||||
"existing",
|
||||
"greenfield",
|
||||
"scaffold"
|
||||
],
|
||||
"type": ["string", "null"],
|
||||
"enum": [null, "existing", "greenfield", "scaffold"],
|
||||
"description": "Type of the target project (set in ANALYSE phase)"
|
||||
},
|
||||
"phases": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"init": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"analyse": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"roadmap": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"design": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"decomposition": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"execution": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"metastate": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
},
|
||||
"handoff": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"skipped"
|
||||
]
|
||||
}
|
||||
"init": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"analyse": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"roadmap": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"design": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"decomposition": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"execution": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"metastate": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] },
|
||||
"handoff": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "skipped"] }
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
@@ -130,28 +47,11 @@
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"archived"
|
||||
]
|
||||
}
|
||||
"id": { "type": "string" },
|
||||
"title": { "type": "string" },
|
||||
"status": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed", "archived"] }
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"status"
|
||||
],
|
||||
"required": ["id", "title", "status"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
@@ -159,46 +59,8 @@
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of last update"
|
||||
},
|
||||
"source_of_truth": {
|
||||
"type": "object"
|
||||
},
|
||||
"uncommitted_work": {
|
||||
"type": "object"
|
||||
},
|
||||
"host_state": {
|
||||
"type": "object"
|
||||
},
|
||||
"closed_attempts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"resolved_doc_drift": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"protocol_deviations": {
|
||||
"type": "object"
|
||||
},
|
||||
"corrections_this_session": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"session_chain": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"metaagent_version",
|
||||
"session_id",
|
||||
"phases",
|
||||
"last_updated"
|
||||
],
|
||||
"required": ["metaagent_version", "session_id", "phases", "last_updated"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -8,11 +8,7 @@
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Schema version (3.0 in v3.0+, 2.0 still valid from v2.1)",
|
||||
"enum": [
|
||||
"2.0",
|
||||
"3.0",
|
||||
"3.0.0"
|
||||
]
|
||||
"enum": ["2.0", "3.0"]
|
||||
},
|
||||
"decisions": {
|
||||
"type": "array",
|
||||
@@ -31,12 +27,7 @@
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"proposed",
|
||||
"accepted",
|
||||
"deprecated",
|
||||
"superseded"
|
||||
],
|
||||
"enum": ["proposed", "accepted", "deprecated", "superseded"],
|
||||
"description": "ADR status"
|
||||
},
|
||||
"file": {
|
||||
@@ -47,74 +38,9 @@
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Decision date (ISO 8601)"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Free-form tags"
|
||||
},
|
||||
"task": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"resolution": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"moot_unless": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"resolved_at": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"related_artifact": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"supersedes_wrong_conclusion_of": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"file"
|
||||
],
|
||||
"required": ["id", "title", "file"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
@@ -127,68 +53,8 @@
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "ISO 8601 timestamp of last update"
|
||||
},
|
||||
"proposals": {
|
||||
"type": "array",
|
||||
"description": "Proposed ADRs not yet accepted (T38+ series)",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"proposed",
|
||||
"accepted",
|
||||
"withdrawn",
|
||||
"rejected"
|
||||
]
|
||||
},
|
||||
"date": {
|
||||
"type": "string"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"task": {
|
||||
"type": "string"
|
||||
},
|
||||
"blocked_by": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resolution": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"status"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"decisions"
|
||||
],
|
||||
"required": ["version", "decisions"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -6,7 +6,9 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"description": "Schema version",
|
||||
"enum": ["3.0"]
|
||||
},
|
||||
"session_id": {
|
||||
"type": "string",
|
||||
@@ -42,26 +44,7 @@
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"feature",
|
||||
"refactor",
|
||||
"test",
|
||||
"fix",
|
||||
"config",
|
||||
"design",
|
||||
"docs",
|
||||
"documentation",
|
||||
"deploy",
|
||||
"implementation",
|
||||
"decision",
|
||||
"verify",
|
||||
"security",
|
||||
"investigation",
|
||||
"review",
|
||||
"upstream",
|
||||
"question",
|
||||
"housekeeping"
|
||||
],
|
||||
"enum": ["feature", "refactor", "test", "fix", "config", "design", "docs", "invariant"],
|
||||
"description": "Task type"
|
||||
},
|
||||
"origin": {
|
||||
@@ -70,23 +53,17 @@
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"items": { "type": "string" },
|
||||
"description": "Files affected by this task"
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"items": { "type": "string" },
|
||||
"description": "Task IDs this task depends on"
|
||||
},
|
||||
"acceptance_criteria": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"items": { "type": "string" },
|
||||
"description": "Measurable criteria for completion"
|
||||
},
|
||||
"context": {
|
||||
@@ -95,13 +72,7 @@
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"completed",
|
||||
"failed",
|
||||
"archived"
|
||||
],
|
||||
"enum": ["pending", "in_progress", "completed", "failed", "archived"],
|
||||
"description": "Current task status"
|
||||
},
|
||||
"claimed_by": {
|
||||
@@ -112,237 +83,13 @@
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "When the task was claimed"
|
||||
},
|
||||
"priority": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"blocks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"notes": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"fixes": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"adr": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"completed_in_commits": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"verified_at": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"severity": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"critical"
|
||||
]
|
||||
},
|
||||
"verified": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"string"
|
||||
]
|
||||
},
|
||||
"fix_landed": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"next_action_required": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"machine_id": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"warning": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"patch_summary": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"moot_after": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"completed_in_session": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"verified_at_host": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"secret_ref": {
|
||||
"type": [
|
||||
"string",
|
||||
"array",
|
||||
"boolean",
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"description": "Project extension field (documented in AGENTS.md / manifest.md)"
|
||||
},
|
||||
"verify_after_deploy": {
|
||||
"type": [
|
||||
"string",
|
||||
"boolean",
|
||||
"array",
|
||||
"object",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"type",
|
||||
"status"
|
||||
],
|
||||
"required": ["id", "title", "type", "status"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"metaagent_version": {
|
||||
"type": "string"
|
||||
},
|
||||
"target_repo": {
|
||||
"type": "string"
|
||||
},
|
||||
"project_type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"existing",
|
||||
"greenfield",
|
||||
"scaffold"
|
||||
]
|
||||
},
|
||||
"date": {
|
||||
"type": "string"
|
||||
},
|
||||
"phases": {
|
||||
"type": "object",
|
||||
"description": "Phase state mirror (checkpoints.json is authoritative)",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"backlog_count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"backlog_count_breakdown": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"backlog_note": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"tasks"
|
||||
],
|
||||
"required": ["version", "tasks"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -1,365 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# MetaAgent — установка исходников в целевой проект
|
||||
# Usage: .\install.ps1 [[-Path] target_path] [-Check] [-Update]
|
||||
|
||||
param(
|
||||
[string]$Path = "",
|
||||
[switch]$Check,
|
||||
[switch]$Update,
|
||||
[switch]$Help
|
||||
)
|
||||
|
||||
$MetaAgentSrc = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
# --- helpers ---
|
||||
function Write-Info { Write-Host " →" -NoNewline -ForegroundColor Blue; Write-Host " $args" }
|
||||
function Write-Ok { Write-Host " ✓" -NoNewline -ForegroundColor Green; Write-Host " $args" }
|
||||
function Write-Skip { Write-Host " −" -NoNewline -ForegroundColor Yellow; Write-Host " $args" }
|
||||
function Write-Warn { Write-Host " ⚠" -NoNewline -ForegroundColor Yellow; Write-Host " $args" }
|
||||
function Write-Fail { Write-Host " ✗" -NoNewline -ForegroundColor Red; Write-Host " $args" }
|
||||
function Write-Header { param([string]$Label)
|
||||
Write-Host ""
|
||||
Write-Host ("─" * 40)
|
||||
Write-Host " $Label"
|
||||
Write-Host ("─" * 40)
|
||||
}
|
||||
|
||||
function Show-Usage {
|
||||
@"
|
||||
Usage: install.ps1 [[-Path] target_path] [-Check] [-Update] [-Help]
|
||||
|
||||
Install MetaAgent sources into <target>/.agent/src/
|
||||
|
||||
Options:
|
||||
-Path Path to target project (default: interactive prompt)
|
||||
-Check Dry-run: only check target readiness, no install
|
||||
-Update Overwrite existing files in .agent/src/
|
||||
-Help Show this help
|
||||
|
||||
Examples:
|
||||
.\install.ps1
|
||||
.\install.ps1 -Path C:\Projects\MyApp
|
||||
.\install.ps1 -Path C:\Projects\MyApp -Check
|
||||
.\install.ps1 -Path C:\Projects\MyApp -Update
|
||||
"@
|
||||
exit 0
|
||||
}
|
||||
|
||||
if ($Help) { Show-Usage }
|
||||
|
||||
# --- resolve target ---
|
||||
$TargetPath = $Path
|
||||
if (-not $TargetPath) {
|
||||
$TargetPath = Read-Host "Enter path to target project"
|
||||
}
|
||||
$TargetPath = $TargetPath.Trim()
|
||||
|
||||
# --- pre-flight -----------------------------------------------------------
|
||||
Write-Header "Pre-flight"
|
||||
|
||||
# 1. target exists?
|
||||
if (-not (Test-Path $TargetPath -PathType Container)) {
|
||||
Write-Fail "Target directory '$TargetPath' does not exist."
|
||||
exit 1
|
||||
}
|
||||
$TargetPath = (Resolve-Path $TargetPath).Path
|
||||
Write-Ok "Target: $TargetPath"
|
||||
|
||||
# 2. write permission? (try to create a temp file as probe)
|
||||
$probe = [System.IO.Path]::Combine($TargetPath, ".metaagent_probe.tmp")
|
||||
try {
|
||||
[System.IO.File]::WriteAllBytes($probe, [byte[]]@())
|
||||
Remove-Item $probe -Force
|
||||
Write-Ok "Write permission: yes"
|
||||
} catch {
|
||||
Write-Fail "No write permission on '$TargetPath'."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# 3. already installed? compare versions
|
||||
$AgentDir = Join-Path $TargetPath ".agent"
|
||||
$SrcDir = Join-Path $AgentDir "src"
|
||||
$VersionFile = Join-Path $MetaAgentSrc "VERSION"
|
||||
|
||||
$Version = if (Test-Path $VersionFile -PathType Leaf) {
|
||||
(Get-Content $VersionFile -Raw -Encoding UTF8).Trim()
|
||||
} else { "?" }
|
||||
|
||||
$oldVerPath = Join-Path $SrcDir "VERSION"
|
||||
if (Test-Path $oldVerPath -PathType Leaf) {
|
||||
$oldVer = (Get-Content $oldVerPath -Raw -Encoding UTF8).Trim()
|
||||
if ($oldVer -ne $Version) {
|
||||
Write-Info "Existing MetaAgent v$oldVer found → upgrading to v$Version"
|
||||
} else {
|
||||
Write-Skip "MetaAgent v${Version} already installed (use -Update to reinstall)"
|
||||
if (-not $Check) {
|
||||
Write-Warn "No changes applied. Run with -Update to overwrite existing files."
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Info "Fresh install: MetaAgent v$Version"
|
||||
}
|
||||
|
||||
# 4. summary
|
||||
$AgentsMd = Join-Path $TargetPath "AGENTS.md"
|
||||
$RulesDir = Join-Path $AgentDir "rules"
|
||||
$DecisionsDir = Join-Path $AgentDir "decisions"
|
||||
$TasksDir = Join-Path $AgentDir "tasks"
|
||||
$ContextDir = Join-Path $AgentDir "context"
|
||||
$ArchiveDir = Join-Path $AgentDir "archive"
|
||||
$RequestsDir = Join-Path $AgentDir "requests"
|
||||
$RoadmapDir = Join-Path $AgentDir "roadmap"
|
||||
$TempDir = Join-Path $TargetPath ".temp"
|
||||
|
||||
$DirList = @(
|
||||
$SrcDir, $RulesDir, $DecisionsDir, $TasksDir,
|
||||
(Join-Path $TasksDir "backlog"), $ContextDir,
|
||||
$ArchiveDir,
|
||||
(Join-Path $ArchiveDir "tasks"),
|
||||
(Join-Path $ArchiveDir "decisions"),
|
||||
(Join-Path $ArchiveDir "checkpoints"),
|
||||
(Join-Path $RequestsDir "active"),
|
||||
(Join-Path $RequestsDir "archive"),
|
||||
$RoadmapDir,
|
||||
(Join-Path $RoadmapDir "archive"),
|
||||
$TempDir
|
||||
)
|
||||
|
||||
if ($Check) {
|
||||
Write-Host ""
|
||||
Write-Info "--check mode: all checks passed, no changes applied."
|
||||
exit 0
|
||||
}
|
||||
|
||||
# --- phase 1: directories ------------------------------------------------
|
||||
Write-Header "Directories"
|
||||
|
||||
foreach ($d in $DirList) {
|
||||
$null = New-Item -ItemType Directory -Path $d -Force
|
||||
$short = $d.Replace("$TargetPath\", "")
|
||||
if (Test-Path $d -PathType Container) {
|
||||
Write-Ok $short
|
||||
} else {
|
||||
Write-Fail "$short (creation failed)"
|
||||
}
|
||||
}
|
||||
|
||||
# --- phase 2: files ------------------------------------------------------
|
||||
Write-Header "Files"
|
||||
|
||||
$copyCount = 0
|
||||
$skipCount = 0
|
||||
$failCount = 0
|
||||
|
||||
function Copy-File {
|
||||
param([string]$Src, [string]$DstDir)
|
||||
$name = Split-Path $Src -Leaf
|
||||
$dst = Join-Path $DstDir $name
|
||||
if (-not (Test-Path $Src -PathType Leaf)) {
|
||||
Write-Skip "$name (source not found)"
|
||||
$script:skipCount++
|
||||
return
|
||||
}
|
||||
if ($Update -or -not (Test-Path $dst)) {
|
||||
try {
|
||||
Copy-Item $Src $dst -Force -ErrorAction Stop
|
||||
Write-Ok $name
|
||||
$script:copyCount++
|
||||
} catch {
|
||||
Write-Fail $name
|
||||
$script:failCount++
|
||||
}
|
||||
} else {
|
||||
Write-Skip "$name (exists, use -Update to overwrite)"
|
||||
$script:skipCount++
|
||||
}
|
||||
}
|
||||
|
||||
function Copy-Dir {
|
||||
param([string]$Src, [string]$DstDir)
|
||||
$name = Split-Path $Src -Leaf
|
||||
$dst = Join-Path $DstDir $name
|
||||
if (-not (Test-Path $Src -PathType Container)) {
|
||||
Write-Skip "$name/ (source not found)"
|
||||
$script:skipCount++
|
||||
return
|
||||
}
|
||||
$null = New-Item -ItemType Directory -Path $dst -Force
|
||||
try {
|
||||
if ($Update) {
|
||||
Get-ChildItem $Src | ForEach-Object {
|
||||
Copy-Item $_.FullName $dst -Recurse -Force -ErrorAction Stop
|
||||
}
|
||||
} else {
|
||||
Get-ChildItem $Src | ForEach-Object {
|
||||
$targetPath = Join-Path $dst $_.Name
|
||||
if (-not (Test-Path $targetPath)) {
|
||||
Copy-Item $_.FullName $dst -Recurse -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Ok "$name/"
|
||||
$script:copyCount++
|
||||
} catch {
|
||||
Write-Fail "$name/ (partial copy)"
|
||||
$script:failCount++
|
||||
}
|
||||
}
|
||||
|
||||
Copy-File (Join-Path $MetaAgentSrc "GUIDE.md") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "BOUNDARIES.md") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "CHANGELOG.md") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "WORKFLOW.md") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "VERSION") $SrcDir
|
||||
Copy-Dir (Join-Path $MetaAgentSrc "PROTOCOLS") $SrcDir
|
||||
Copy-Dir (Join-Path $MetaAgentSrc "COMMANDS") $SrcDir
|
||||
Copy-Dir (Join-Path $MetaAgentSrc "TEMPLATES") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "install.sh") $SrcDir
|
||||
Copy-File (Join-Path $MetaAgentSrc "install.ps1") $SrcDir
|
||||
|
||||
# --- phase 3: AGENTS.md --------------------------------------------------
|
||||
Write-Header "AGENTS.md"
|
||||
|
||||
if (-not (Test-Path $AgentsMd -PathType Leaf)) {
|
||||
$content = @"
|
||||
# MetaAgent
|
||||
|
||||
Этот проект использует [MetaAgent](.agent/src/GUIDE.md) v$Version —
|
||||
набор инструкций для AI-агента.
|
||||
|
||||
## Контекст MetaAgent
|
||||
|
||||
| Ресурс | Путь |
|
||||
|--------|------|
|
||||
| Главная инструкция | `.agent/src/GUIDE.md` |
|
||||
| Протоколы фаз | `.agent/src/PROTOCOLS/` |
|
||||
| Команды (on-demand) | `.agent/src/COMMANDS/` |
|
||||
| Шаблоны артефактов | `.agent/src/TEMPLATES/` |
|
||||
| Границы (что разрешено/запрещено) | `.agent/src/BOUNDARIES.md` |
|
||||
| История версий | `.agent/src/CHANGELOG.md` |
|
||||
| Правила проекта | `.agent/rules/project-rules.md` |
|
||||
| Пример работы | `.agent/src/WORKFLOW.md` |
|
||||
| Версия | `.agent/src/VERSION` |
|
||||
|
||||
## Состояние сессии (если инициализировано)
|
||||
|
||||
| Артефакт | Путь |
|
||||
|----------|------|
|
||||
| Чекпоинты сессии | `.agent/checkpoints.json` |
|
||||
| Слепок проекта | `.agent/context/project-state.md` |
|
||||
| Анализ репозитория | `.agent/context/analysis-report.md` |
|
||||
| Дорожная карта | `.agent/roadmap/sources.md` |
|
||||
| Манифест задач | `.agent/tasks/manifest.json` |
|
||||
| Сводка для следующего агента | `.agent/handoff-summary.md` |
|
||||
| Сводка сессии | `.agent/session-summary.md` |
|
||||
|
||||
## Для агента
|
||||
|
||||
Жизненный цикл MetaAgent v$Version:
|
||||
|
||||
```
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
```
|
||||
|
||||
1. **Прочитай** `.agent/src/GUIDE.md` — пойми цикл и доступные команды.
|
||||
2. **Прочитай** `.agent/src/BOUNDARIES.md` — соблюдай границы.
|
||||
3. **Прочитай** `.agent/rules/project-rules.md` — выполни правила пользователя.
|
||||
4. **Проверь** `.agent/checkpoints.json` — если существует, используй как состояние сессии.
|
||||
5. **Проверь** `.agent/context/project-state.md` — получи актуальную картину.
|
||||
6. **Проверь** `.agent/tasks/manifest.json` — если существует, выполняй задачи по порядку.
|
||||
7. Если `.agent/` не инициализирован или устарел — запусти `install.sh --update` для
|
||||
обновления исходников MetaAgent до актуальной версии.
|
||||
|
||||
## Команды (on-demand)
|
||||
|
||||
В любой момент пользователь может вызвать:
|
||||
- `/adr` — записать архитектурное решение
|
||||
- `/red-team` — попытаться сломать дизайн
|
||||
- `/risk-register` — зафиксировать допущения
|
||||
- `/alt-arch` — описать альтернативу
|
||||
- `/invariant-tests` — тесты-инварианты для ADR
|
||||
"@
|
||||
$utf8 = [System.Text.Encoding]::UTF8
|
||||
[System.IO.File]::WriteAllBytes($AgentsMd, $utf8.GetBytes($content))
|
||||
Write-Ok "AGENTS.md created"
|
||||
} elseif ($Update) {
|
||||
$content = @"
|
||||
# MetaAgent
|
||||
|
||||
Этот проект использует [MetaAgent](.agent/src/GUIDE.md) v$Version —
|
||||
набор инструкций для AI-агента.
|
||||
|
||||
## Контекст MetaAgent
|
||||
|
||||
| Ресурс | Путь |
|
||||
|--------|------|
|
||||
| Главная инструкция | `.agent/src/GUIDE.md` |
|
||||
| Протоколы фаз | `.agent/src/PROTOCOLS/` |
|
||||
| Команды (on-demand) | `.agent/src/COMMANDS/` |
|
||||
| Шаблоны артефактов | `.agent/src/TEMPLATES/` |
|
||||
| Границы (что разрешено/запрещено) | `.agent/src/BOUNDARIES.md` |
|
||||
| История версий | `.agent/src/CHANGELOG.md` |
|
||||
| Правила проекта | `.agent/rules/project-rules.md` |
|
||||
| Пример работы | `.agent/src/WORKFLOW.md` |
|
||||
| Версия | `.agent/src/VERSION` |
|
||||
|
||||
## Состояние сессии (если инициализировано)
|
||||
|
||||
| Артефакт | Путь |
|
||||
|----------|------|
|
||||
| Чекпоинты сессии | `.agent/checkpoints.json` |
|
||||
| Слепок проекта | `.agent/context/project-state.md` |
|
||||
| Анализ репозитория | `.agent/context/analysis-report.md` |
|
||||
| Дорожная карта | `.agent/roadmap/sources.md` |
|
||||
| Манифест задач | `.agent/tasks/manifest.json` |
|
||||
| Сводка для следующего агента | `.agent/handoff-summary.md` |
|
||||
| Сводка сессии | `.agent/session-summary.md` |
|
||||
|
||||
## Для агента
|
||||
|
||||
Жизненный цикл MetaAgent v$Version:
|
||||
|
||||
```
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
```
|
||||
|
||||
1. **Прочитай** `.agent/src/GUIDE.md` — пойми цикл и доступные команды.
|
||||
2. **Прочитай** `.agent/src/BOUNDARIES.md` — соблюдай границы.
|
||||
3. **Прочитай** `.agent/rules/project-rules.md` — выполни правила пользователя.
|
||||
4. **Проверь** `.agent/checkpoints.json` — если существует, используй как состояние сессии.
|
||||
5. **Проверь** `.agent/context/project-state.md` — получи актуальную картину.
|
||||
6. **Проверь** `.agent/tasks/manifest.json` — если существует, выполняй задачи по порядку.
|
||||
7. Если `.agent/` не инициализирован или устарел — запусти `install.sh --update` для
|
||||
обновления исходников MetaAgent до актуальной версии.
|
||||
|
||||
## Команды (on-demand)
|
||||
|
||||
В любой момент пользователь может вызвать:
|
||||
- `/adr` — записать архитектурное решение
|
||||
- `/red-team` — попытаться сломать дизайн
|
||||
- `/risk-register` — зафиксировать допущения
|
||||
- `/alt-arch` — описать альтернативу
|
||||
- `/invariant-tests` — тесты-инварианты для ADR
|
||||
"@
|
||||
$utf8 = [System.Text.Encoding]::UTF8
|
||||
[System.IO.File]::WriteAllBytes($AgentsMd, $utf8.GetBytes($content))
|
||||
Write-Ok "AGENTS.md updated"
|
||||
} else {
|
||||
Write-Skip "AGENTS.md (exists, use -Update to overwrite)"
|
||||
$script:skipCount++
|
||||
}
|
||||
|
||||
# --- summary -------------------------------------------------------------
|
||||
Write-Header "Summary"
|
||||
Write-Host " MetaAgent v$Version → $SrcDir"
|
||||
Write-Host ""
|
||||
if ($copyCount -gt 0) { Write-Ok "$copyCount file(s) copied" }
|
||||
if ($skipCount -gt 0) { Write-Skip "$skipCount file(s) skipped" }
|
||||
if ($failCount -gt 0) { Write-Fail "$failCount file(s) failed" }
|
||||
Write-Host ""
|
||||
if ($failCount -eq 0) {
|
||||
Write-Ok "Installation completed successfully."
|
||||
} else {
|
||||
Write-Fail "Installation completed with $failCount error(s)."
|
||||
exit 1
|
||||
}
|
||||
Regular → Executable
+234
-77
@@ -1,6 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# MetaAgent — установка исходников в целевой проект
|
||||
# MetaAgent — установка кита в целевой проект: это ВЕСЬ INIT, не только копия
|
||||
# исходников.
|
||||
#
|
||||
# Usage: ./install.sh [--check|--update] [target_path]
|
||||
#
|
||||
# ЧТО СОЗДАЁТСЯ
|
||||
# -------------
|
||||
# <target>/.agent/src/... кит, файл в файл по KIT-MANIFEST.tsv
|
||||
# <target>/.agent/checkpoints.json литерал из PROTOCOLS/00_INIT.md §0.8,
|
||||
# по TEMPLATES/schemas/checkpoints-schema.json
|
||||
# <target>/.agent/rules/project-rules.md из TEMPLATES/project-rules.md
|
||||
# <target>/.agent/decisions/index.json {"version":"3.0","decisions":[]},
|
||||
# по TEMPLATES/schemas/decisions-index-schema.json
|
||||
# <target>/.temp/ + строка `.temp/` в <target>/.gitignore
|
||||
# <target>/AGENTS.md из AGENTS.template.md, {VERSION} подставлен
|
||||
#
|
||||
# ДВА РАЗНЫХ ПРАВИЛА, И ЭТО НАМЕРЕННО
|
||||
# -----------------------------------
|
||||
# `.agent/src/` — копия кита. Перезаписывается ТОЛЬКО с `--update`.
|
||||
# Всё остальное — данные проекта: checkpoints, правила, реестр ADR,
|
||||
# `.gitignore`, `AGENTS.md`. Пишется ТОЛЬКО если файла нет; не
|
||||
# перезаписывается никогда, ни на первом прогоне, ни с `--update`.
|
||||
# `--update` — это «обнови кит», а не «снеси моё состояние»: правила и
|
||||
# чекпоинты принадлежат проекту, и установщик не знает, что в них важного.
|
||||
#
|
||||
# ИДЕМПОТЕНТНОСТЬ: второй прогон не меняет ни одного пути, ни одного размера
|
||||
# и ни одной mtime (проверяется tests/sh-framework-install-init.sh).
|
||||
set -euo pipefail
|
||||
|
||||
METAAGENT_SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
@@ -23,11 +48,15 @@ usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [--check|--update] [target_path]
|
||||
|
||||
Install MetaAgent sources into <target>/.agent/src/
|
||||
Install the MetaAgent kit into <target>/.agent/src/ and finish INIT:
|
||||
checkpoints.json, rules/project-rules.md, decisions/index.json,
|
||||
.temp/ + .gitignore, AGENTS.md.
|
||||
|
||||
Options:
|
||||
--check, -c Dry-run: only check target readiness, no install
|
||||
--update, -u Overwrite existing files in .agent/src/
|
||||
--check, -c Dry-run: check the target and print what INIT would create
|
||||
--update, -u Overwrite existing files in .agent/src/ (the kit copy ONLY —
|
||||
checkpoints, rules, decisions, .gitignore and AGENTS.md are
|
||||
never overwritten, not even with --update)
|
||||
--help, -h Show this help
|
||||
|
||||
Examples:
|
||||
@@ -88,6 +117,16 @@ AGENT_DIR="$TARGET_PATH/.agent"
|
||||
SRC_DIR="$AGENT_DIR/src"
|
||||
VERSION="$(cat "$METAAGENT_SRC/VERSION" 2>/dev/null || echo '?')"
|
||||
|
||||
# The version is not decoration: it is written into .agent/checkpoints.json,
|
||||
# whose schema pins it to ^[0-9]+\.[0-9]+\.[0-9]+$. A malformed VERSION would
|
||||
# produce a checkpoints file that no protocol can trust, so the installer
|
||||
# stops here instead of writing one.
|
||||
if ! printf '%s' "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||
fail "framework/VERSION is '$VERSION' — not a MAJOR.MINOR.PATCH version."
|
||||
fail "INIT writes it into .agent/checkpoints.json, and checkpoints-schema.json requires that shape."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$SRC_DIR/VERSION" ]]; then
|
||||
OLD_VER="$(cat "$SRC_DIR/VERSION" 2>/dev/null || echo '?')"
|
||||
if [[ "$OLD_VER" != "$VERSION" ]]; then
|
||||
@@ -118,8 +157,27 @@ REQUESTS_ARCHIVE_DIR="$REQUESTS_DIR/archive"
|
||||
ROADMAP_DIR="$AGENT_DIR/roadmap"
|
||||
ROADMAP_ARCHIVE_DIR="$ROADMAP_DIR/archive"
|
||||
TEMP_DIR="$TARGET_PATH/.temp"
|
||||
ARCHIVE_REQUESTS_DIR="$ARCHIVE_DIR/requests"
|
||||
CHECKPOINTS_JSON="$AGENT_DIR/checkpoints.json"
|
||||
PROJECT_RULES_MD="$RULES_DIR/project-rules.md"
|
||||
DECISIONS_INDEX_JSON="$DECISIONS_DIR/index.json"
|
||||
GITIGNORE="$TARGET_PATH/.gitignore"
|
||||
|
||||
if [[ "$CHECK" == true ]]; then
|
||||
echo ""
|
||||
info "INIT artefacts (a real run would create the missing ones, and only those):"
|
||||
for f in "$CHECKPOINTS_JSON" "$PROJECT_RULES_MD" "$DECISIONS_INDEX_JSON" "$GITIGNORE" "$AGENTS_MD"; do
|
||||
if [[ -f "$f" ]]; then
|
||||
skip "${f#$TARGET_PATH/} (exists — kept as is)"
|
||||
else
|
||||
info "${f#$TARGET_PATH/} (would be created)"
|
||||
fi
|
||||
done
|
||||
if [[ -d "$TEMP_DIR" ]]; then
|
||||
skip ".temp/ (exists)"
|
||||
else
|
||||
info ".temp/ (would be created)"
|
||||
fi
|
||||
echo ""
|
||||
info "${ylw}--check mode:${rst} all checks passed, no changes applied."
|
||||
exit 0
|
||||
@@ -130,14 +188,14 @@ header "Directories"
|
||||
|
||||
mkdir -p "$SRC_DIR" "$RULES_DIR" "$DECISIONS_DIR" "$TASKS_DIR" "$TASKS_DIR/backlog" \
|
||||
"$CONTEXT_DIR" "$ARCHIVE_DIR" "$ARCHIVE_TASKS_DIR" "$ARCHIVE_DECISIONS_DIR" \
|
||||
"$ARCHIVE_CHECKPOINTS_DIR" \
|
||||
"$ARCHIVE_REQUESTS_DIR" "$ARCHIVE_CHECKPOINTS_DIR" \
|
||||
"$REQUESTS_ACTIVE_DIR" "$REQUESTS_ARCHIVE_DIR" \
|
||||
"$ROADMAP_DIR" "$ROADMAP_ARCHIVE_DIR" \
|
||||
"$TEMP_DIR"
|
||||
|
||||
for d in "$SRC_DIR" "$RULES_DIR" "$DECISIONS_DIR" "$TASKS_DIR" "$TASKS_DIR/backlog" \
|
||||
"$CONTEXT_DIR" "$ARCHIVE_DIR" "$ARCHIVE_TASKS_DIR" "$ARCHIVE_DECISIONS_DIR" \
|
||||
"$ARCHIVE_CHECKPOINTS_DIR" \
|
||||
"$ARCHIVE_REQUESTS_DIR" "$ARCHIVE_CHECKPOINTS_DIR" \
|
||||
"$REQUESTS_ACTIVE_DIR" "$REQUESTS_ARCHIVE_DIR" \
|
||||
"$ROADMAP_DIR" "$ROADMAP_ARCHIVE_DIR" \
|
||||
"$TEMP_DIR"; do
|
||||
@@ -208,86 +266,176 @@ copy_file "$METAAGENT_SRC/GUIDE.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/BOUNDARIES.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/CHANGELOG.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/WORKFLOW.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/README.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/AGENTS.template.md" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/VERSION" "$SRC_DIR"
|
||||
copy_dir "$METAAGENT_SRC/PROTOCOLS" "$SRC_DIR"
|
||||
copy_dir "$METAAGENT_SRC/COMMANDS" "$SRC_DIR"
|
||||
copy_dir "$METAAGENT_SRC/TEMPLATES" "$SRC_DIR"
|
||||
copy_dir "$METAAGENT_SRC/FUTURE" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/install.sh" "$SRC_DIR"
|
||||
copy_file "$METAAGENT_SRC/install.ps1" "$SRC_DIR"
|
||||
|
||||
# --- phase 3: AGENTS.md --------------------------------------------------
|
||||
header "AGENTS.md"
|
||||
# --- phase 3: INIT artefacts ---------------------------------------------
|
||||
# 00_INIT.md §0.4 and §0.6-§0.9. These files are the DATA OF THE PROJECT, not
|
||||
# the kit: they are written when absent and NEVER overwritten — `--update` is
|
||||
# about `.agent/src/`, and an installer that rewrote checkpoints.json or
|
||||
# project-rules.md would destroy the only state the phases read.
|
||||
header "INIT artefacts (written only if absent — never overwritten)"
|
||||
|
||||
create_agents_md() {
|
||||
cat > "$1" << AGENTS_EOF
|
||||
# MetaAgent
|
||||
INIT_CREATED=0
|
||||
INIT_KEPT=0
|
||||
|
||||
Этот проект использует [MetaAgent](.agent/src/GUIDE.md) v$VERSION —
|
||||
набор инструкций для AI-агента.
|
||||
|
||||
## Контекст MetaAgent
|
||||
|
||||
| Ресурс | Путь |
|
||||
|--------|------|
|
||||
| Главная инструкция | \`.agent/src/GUIDE.md\` |
|
||||
| Протоколы фаз | \`.agent/src/PROTOCOLS/\` |
|
||||
| Команды (on-demand) | \`.agent/src/COMMANDS/\` |
|
||||
| Шаблоны артефактов | \`.agent/src/TEMPLATES/\` |
|
||||
| Границы (что разрешено/запрещено) | \`.agent/src/BOUNDARIES.md\` |
|
||||
| История версий | \`.agent/src/CHANGELOG.md\` |
|
||||
| Правила проекта | \`.agent/rules/project-rules.md\` |
|
||||
| Пример работы | \`.agent/src/WORKFLOW.md\` |
|
||||
| Версия | \`.agent/src/VERSION\` |
|
||||
|
||||
## Состояние сессии (если инициализировано)
|
||||
|
||||
| Артефакт | Путь |
|
||||
|----------|------|
|
||||
| Чекпоинты сессии | \`.agent/checkpoints.json\` |
|
||||
| Слепок проекта | \`.agent/context/project-state.md\` |
|
||||
| Анализ репозитория | \`.agent/context/analysis-report.md\` |
|
||||
| Дорожная карта | \`.agent/roadmap/sources.md\` |
|
||||
| Манифест задач | \`.agent/tasks/manifest.json\` |
|
||||
| Сводка для следующего агента | \`.agent/handoff-summary.md\` |
|
||||
| Сводка сессии | \`.agent/session-summary.md\` |
|
||||
|
||||
## Для агента
|
||||
|
||||
Жизненный цикл MetaAgent v$VERSION:
|
||||
|
||||
\`\`\`
|
||||
INIT → ANALYSE → ROADMAP → [DESIGN] → DECOMPOSITION → EXECUTION → METASTATE → HANDOFF
|
||||
\`\`\`
|
||||
|
||||
1. **Прочитай** \`.agent/src/GUIDE.md\` — пойми цикл и доступные команды.
|
||||
2. **Прочитай** \`.agent/src/BOUNDARIES.md\` — соблюдай границы.
|
||||
3. **Прочитай** \`.agent/rules/project-rules.md\` — выполни правила пользователя.
|
||||
4. **Проверь** \`.agent/checkpoints.json\` — если существует, используй как состояние сессии.
|
||||
5. **Проверь** \`.agent/context/project-state.md\` — получи актуальную картину.
|
||||
6. **Проверь** \`.agent/tasks/manifest.json\` — если существует, выполняй задачи по порядку.
|
||||
7. Если \`.agent/\` не инициализирован или устарел — запусти \`install.sh --update\` для
|
||||
обновления исходников MetaAgent до актуальной версии.
|
||||
|
||||
## Команды (on-demand)
|
||||
|
||||
В любой момент пользователь может вызвать:
|
||||
- \`/adr\` — записать архитектурное решение
|
||||
- \`/red-team\` — попытаться сломать дизайн
|
||||
- \`/risk-register\` — зафиксировать допущения
|
||||
- \`/alt-arch\` — описать альтернативу
|
||||
- \`/invariant-tests\` — тесты-инварианты для ADR
|
||||
AGENTS_EOF
|
||||
# _json_str <text> — the body of a JSON string: backslash and double quote
|
||||
# escaped. A path is the only thing that goes in here, and a path may hold both.
|
||||
_json_str() {
|
||||
local s="$1"
|
||||
s="${s//\\/\\\\}"
|
||||
s="${s//\"/\\\"}"
|
||||
printf '%s' "$s"
|
||||
}
|
||||
|
||||
if [[ ! -f "$AGENTS_MD" ]]; then
|
||||
create_agents_md "$AGENTS_MD"
|
||||
ok "AGENTS.md created"
|
||||
elif [[ "$UPDATE" == true ]]; then
|
||||
create_agents_md "$AGENTS_MD"
|
||||
ok "AGENTS.md updated"
|
||||
# _uuid — a session id. /proc first (Linux), uuidgen second (git-bash with
|
||||
# coreutils), /dev/urandom third: the kit must install on a host that has
|
||||
# neither python3 nor the director.
|
||||
_uuid() {
|
||||
if [[ -r /proc/sys/kernel/random/uuid ]]; then
|
||||
tr -d '\r\n' < /proc/sys/kernel/random/uuid
|
||||
return 0
|
||||
fi
|
||||
if command -v uuidgen >/dev/null 2>&1; then
|
||||
uuidgen | tr 'A-Z' 'a-z' | tr -d '\r\n'
|
||||
return 0
|
||||
fi
|
||||
local h
|
||||
h="$(od -An -N16 -tx1 /dev/urandom 2>/dev/null | tr -d ' \n\r')"
|
||||
if [[ "${#h}" -ne 32 ]]; then
|
||||
printf '00000000-0000-4000-8000-%012d' "$$"
|
||||
return 0
|
||||
fi
|
||||
printf '%s-%s-4%s-8%s-%s' "${h:0:8}" "${h:8:4}" "${h:13:3}" "${h:17:3}" "${h:20:12}"
|
||||
}
|
||||
|
||||
# _write_atomic <dst> — stdin to <dst> through tmp + mv: a half-written
|
||||
# checkpoints.json is a checkpoint no phase can read.
|
||||
_write_atomic() {
|
||||
local dst="$1" tmp="$1.tmp.$$"
|
||||
cat > "$tmp" && mv "$tmp" "$dst"
|
||||
}
|
||||
|
||||
# _init_absent <dst> <label> — the one rule for every INIT artefact: write it
|
||||
# when it is not there, keep it when it is.
|
||||
_init_absent() {
|
||||
if [[ -f "$1" ]]; then
|
||||
skip "$2 (exists — kept as is)"
|
||||
INIT_KEPT=$((INIT_KEPT + 1))
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# .agent/rules/project-rules.md — 00_INIT.md §0.6, from TEMPLATES/.
|
||||
if _init_absent "$PROJECT_RULES_MD" "rules/project-rules.md"; then
|
||||
if [[ -f "$METAAGENT_SRC/TEMPLATES/project-rules.md" ]]; then
|
||||
if cp "$METAAGENT_SRC/TEMPLATES/project-rules.md" "$PROJECT_RULES_MD"; then
|
||||
ok "rules/project-rules.md (from TEMPLATES/project-rules.md)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
else
|
||||
fail "rules/project-rules.md"
|
||||
FAIL_COUNT=$((FAIL_COUNT + 1))
|
||||
fi
|
||||
else
|
||||
fail "rules/project-rules.md (TEMPLATES/project-rules.md is missing from the kit)"
|
||||
FAIL_COUNT=$((FAIL_COUNT + 1))
|
||||
fi
|
||||
fi
|
||||
|
||||
# .agent/decisions/index.json — 00_INIT.md §0.7, the machine-readable ADR
|
||||
# index that 02_ROADMAP.md §"если существует" and 06_METASTATE.md read. Shape
|
||||
# from TEMPLATES/schemas/decisions-index-schema.json: version ∈ {2.0, 3.0},
|
||||
# decisions is a list. No timestamps: created_at/updated_at are optional in
|
||||
# the schema, and an empty index has no creation event to record.
|
||||
if _init_absent "$DECISIONS_INDEX_JSON" "decisions/index.json"; then
|
||||
printf '{\n "version": "3.0",\n "decisions": []\n}\n' | _write_atomic "$DECISIONS_INDEX_JSON"
|
||||
ok "decisions/index.json (version 3.0, no decisions yet)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
fi
|
||||
|
||||
# .agent/checkpoints.json — 00_INIT.md §0.8 literal, and it must satisfy
|
||||
# TEMPLATES/schemas/checkpoints-schema.json: the eight phase names, the five
|
||||
# statuses, metaagent_version as MAJOR.MINOR.PATCH, no key the schema does not
|
||||
# declare. (The repo's own `.agent/checkpoints.json` is NOT the model: its
|
||||
# statuses are free text like "completed (2026-10-27: ...)" and would violate
|
||||
# the enum. This is built from the schema + the protocol, not copied.)
|
||||
if _init_absent "$CHECKPOINTS_JSON" "checkpoints.json"; then
|
||||
{
|
||||
printf '{\n'
|
||||
printf ' "metaagent_version": "%s",\n' "$VERSION"
|
||||
printf ' "session_id": "%s",\n' "$(_uuid)"
|
||||
printf ' "target_repo": "%s",\n' "$(_json_str "$TARGET_PATH")"
|
||||
printf ' "goal": null,\n'
|
||||
printf ' "project_type": null,\n'
|
||||
printf ' "phases": {\n'
|
||||
printf ' "init": "completed",\n'
|
||||
printf ' "analyse": "pending",\n'
|
||||
printf ' "roadmap": "pending",\n'
|
||||
printf ' "design": "pending",\n'
|
||||
printf ' "decomposition": "pending",\n'
|
||||
printf ' "execution": "pending",\n'
|
||||
printf ' "metastate": "pending",\n'
|
||||
printf ' "handoff": "pending"\n'
|
||||
printf ' },\n'
|
||||
printf ' "tasks": [],\n'
|
||||
printf ' "last_updated": "%s"\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
printf '}\n'
|
||||
} | _write_atomic "$CHECKPOINTS_JSON"
|
||||
ok "checkpoints.json (00_INIT.md §0.8, phases.init = completed)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
fi
|
||||
|
||||
# .temp/ in .gitignore — 00_INIT.md §0.4. The comparison strips CR: a
|
||||
# .gitignore with CRLF endings makes `grep -xF '.temp/'` answer "absent" for a
|
||||
# line that IS there (AGENTS.md, ловушка 2), and the installer would append a
|
||||
# duplicate line on every run — the opposite of idempotent.
|
||||
if [[ -f "$GITIGNORE" ]] && tr -d '\r' < "$GITIGNORE" | grep -qxF '.temp/'; then
|
||||
skip ".gitignore (.temp/ already ignored)"
|
||||
INIT_KEPT=$((INIT_KEPT + 1))
|
||||
elif [[ ! -f "$GITIGNORE" ]]; then
|
||||
printf '.temp/\n' > "$GITIGNORE"
|
||||
ok ".gitignore (created with the single line .temp/)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
else
|
||||
skip "AGENTS.md (exists, use --update to overwrite)"
|
||||
SKIP_COUNT=$((SKIP_COUNT + 1))
|
||||
# Append; every existing byte stays where it is. A file whose last line has
|
||||
# no trailing newline would otherwise swallow the new line into it.
|
||||
if [[ -n "$(tail -c 1 "$GITIGNORE")" ]]; then
|
||||
printf '\n' >> "$GITIGNORE"
|
||||
fi
|
||||
printf '.temp/\n' >> "$GITIGNORE"
|
||||
ok ".gitignore (appended .temp/)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
fi
|
||||
|
||||
# --- phase 4: AGENTS.md (00_INIT.md §0.9) --------------------------------
|
||||
# Rendered from AGENTS.template.md — the ONE description of what the project's
|
||||
# AGENTS.md says. The installer used to carry a SECOND copy as a heredoc, and
|
||||
# the two had already drifted (the heredoc lacked the requests/ADR rows and the
|
||||
# "начни с METASTATE" step). {VERSION} is the only placeholder the template
|
||||
# needs; the lifecycle line stays "v3.0" on purpose, because it names the
|
||||
# MODEL, not the kit version (VERSION is 3.0.0).
|
||||
header "AGENTS.md"
|
||||
|
||||
if [[ ! -f "$METAAGENT_SRC/AGENTS.template.md" ]]; then
|
||||
fail "AGENTS.md (AGENTS.template.md is missing from the kit)"
|
||||
FAIL_COUNT=$((FAIL_COUNT + 1))
|
||||
elif [[ -f "$AGENTS_MD" ]]; then
|
||||
# NEVER overwritten — not on the first run, not on --update. The file may
|
||||
# be the owner's, or an older MetaAgent's with local edits; the installer
|
||||
# cannot tell the two apart, and overwriting either is not recoverable.
|
||||
skip "AGENTS.md (exists — never overwritten, not even with --update)"
|
||||
INIT_KEPT=$((INIT_KEPT + 1))
|
||||
else
|
||||
sed "s|{VERSION}|$VERSION|g" "$METAAGENT_SRC/AGENTS.template.md" | _write_atomic "$AGENTS_MD"
|
||||
ok "AGENTS.md (from AGENTS.template.md, {VERSION} → $VERSION)"
|
||||
INIT_CREATED=$((INIT_CREATED + 1))
|
||||
fi
|
||||
|
||||
# --- summary -------------------------------------------------------------
|
||||
@@ -295,15 +443,24 @@ header "Summary"
|
||||
echo " MetaAgent v$VERSION → $SRC_DIR"
|
||||
echo ""
|
||||
if (( COPY_COUNT > 0 )); then
|
||||
ok "${COPY_COUNT} file(s) copied"
|
||||
ok "${COPY_COUNT} kit file(s) copied"
|
||||
fi
|
||||
if (( SKIP_COUNT > 0 )); then
|
||||
skip "${SKIP_COUNT} file(s) skipped"
|
||||
skip "${SKIP_COUNT} kit file(s) skipped (already present — --update refreshes them)"
|
||||
fi
|
||||
if (( INIT_CREATED > 0 )); then
|
||||
ok "${INIT_CREATED} INIT artefact(s) created"
|
||||
fi
|
||||
if (( INIT_KEPT > 0 )); then
|
||||
skip "${INIT_KEPT} INIT artefact(s) already present (kept — never overwritten)"
|
||||
fi
|
||||
if (( FAIL_COUNT > 0 )); then
|
||||
fail "${FAIL_COUNT} file(s) failed"
|
||||
fi
|
||||
echo ""
|
||||
echo " INIT artefacts (checkpoints, rules, decisions, .gitignore, AGENTS.md) are"
|
||||
echo " the project's data: this installer writes them only when they are absent."
|
||||
echo ""
|
||||
if (( FAIL_COUNT == 0 )); then
|
||||
ok "Installation completed successfully."
|
||||
else
|
||||
|
||||
@@ -30,5 +30,8 @@
|
||||
# node < 18 отсутствует («herdr web ui needs Node 18 or newer for its
|
||||
# terminal sidecar»). На sapphira node уже был через opencode.nix, на
|
||||
# rydiwo нет — добавляем сюда, чтобы plugin-install прошёл preflight.
|
||||
home.packages = with pkgs; [ bun nodejs_22 ];
|
||||
home.packages = with pkgs; [
|
||||
bun
|
||||
nodejs_22
|
||||
];
|
||||
}
|
||||
@@ -100,11 +100,21 @@ let
|
||||
# Конфиг slim-плагина — зеркало vetymae (~/.config/opencode/oh-my-opencode-slim.json).
|
||||
slimConfig = {
|
||||
agents = {
|
||||
orchestrator = { model = modelFast; };
|
||||
explorer = { model = modelFast; };
|
||||
oracle = { model = modelFast; };
|
||||
designer = { model = modelFast; };
|
||||
fixer = { model = modelFast; };
|
||||
orchestrator = {
|
||||
model = modelFast;
|
||||
};
|
||||
explorer = {
|
||||
model = modelFast;
|
||||
};
|
||||
oracle = {
|
||||
model = modelFast;
|
||||
};
|
||||
designer = {
|
||||
model = modelFast;
|
||||
};
|
||||
fixer = {
|
||||
model = modelFast;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -210,12 +220,36 @@ in
|
||||
# Границы: это заменяет клик мышью, а не правила безопасности агента —
|
||||
# secrets/, *.env, *.pem и .ssh/ остаются вне зоны по политике.
|
||||
permissions = [
|
||||
{ action = "external_directory"; resource = "*"; effect = "allow"; }
|
||||
{ action = "read"; resource = "*"; effect = "allow"; }
|
||||
{ action = "edit"; resource = "*"; effect = "allow"; }
|
||||
{ action = "bash"; resource = "*"; effect = "allow"; }
|
||||
{ action = "webfetch"; resource = "*"; effect = "allow"; }
|
||||
{ action = "websearch"; resource = "*"; effect = "allow"; }
|
||||
{
|
||||
action = "external_directory";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "read";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "edit";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "bash";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "webfetch";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "websearch";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
+45
-11
@@ -120,11 +120,21 @@ let
|
||||
# ~/.config/opencode/oh-my-opencode-slim.json
|
||||
slimConfig = {
|
||||
agents = {
|
||||
orchestrator = { model = modelFast; };
|
||||
explorer = { model = modelFast; };
|
||||
oracle = { model = modelFast; };
|
||||
designer = { model = modelFast; };
|
||||
fixer = { model = modelFast; };
|
||||
orchestrator = {
|
||||
model = modelFast;
|
||||
};
|
||||
explorer = {
|
||||
model = modelFast;
|
||||
};
|
||||
oracle = {
|
||||
model = modelFast;
|
||||
};
|
||||
designer = {
|
||||
model = modelFast;
|
||||
};
|
||||
fixer = {
|
||||
model = modelFast;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
@@ -215,12 +225,36 @@ in
|
||||
# safety rules of the agent itself — `secrets/`, `*.env`, `*.pem` and
|
||||
# `.ssh/` stay off-limits by policy, not by prompt.
|
||||
permissions = [
|
||||
{ action = "external_directory"; resource = "*"; effect = "allow"; }
|
||||
{ action = "read"; resource = "*"; effect = "allow"; }
|
||||
{ action = "edit"; resource = "*"; effect = "allow"; }
|
||||
{ action = "bash"; resource = "*"; effect = "allow"; }
|
||||
{ action = "webfetch"; resource = "*"; effect = "allow"; }
|
||||
{ action = "websearch"; resource = "*"; effect = "allow"; }
|
||||
{
|
||||
action = "external_directory";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "read";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "edit";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "bash";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "webfetch";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
{
|
||||
action = "websearch";
|
||||
resource = "*";
|
||||
effect = "allow";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
+10
-2
@@ -15,8 +15,16 @@
|
||||
# Keep the list sorted by purpose: the first group is the default set the
|
||||
# runner has always had, the rest are tools a specific workflow needs.
|
||||
{ pkgs }:
|
||||
with pkgs; [
|
||||
bash coreutils curl gawk gitMinimal gnused nodejs wget
|
||||
with pkgs;
|
||||
[
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
gawk
|
||||
gitMinimal
|
||||
gnused
|
||||
nodejs
|
||||
wget
|
||||
nix
|
||||
python3
|
||||
cacert
|
||||
|
||||
@@ -205,7 +205,8 @@ in
|
||||
# The unit name must be the REAL unit of the service (e.g. `samba-smbd`,
|
||||
# `phpfpm-nextcloud`, `immich-server`) — see ADR-0004: a wrong key renders a
|
||||
# phantom unit with no ExecStart, and systemd refuses to start it.
|
||||
mkStorageGuard = xlib:
|
||||
mkStorageGuard =
|
||||
xlib:
|
||||
lib.optionalAttrs (xlib.device.type != "vds") {
|
||||
# Guard via ConditionPathIsMountPoint ONLY — see (b) above for why
|
||||
# RequiresMountsFor must NOT be added.
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.modules."3x-ui";
|
||||
in
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
#qogir-kde
|
||||
#qogir-theme
|
||||
qogir-icon-theme
|
||||
whitesur-cursors # WhiteSur look-and-feel sets this cursor; without it
|
||||
# kwin logs `Failed to load cursor theme "WhiteSur-cursors"`
|
||||
whitesur-cursors
|
||||
# WhiteSur look-and-feel sets this cursor; without it
|
||||
# kwin logs `Failed to load cursor theme "WhiteSur-cursors"`
|
||||
whitesur-gtk-theme
|
||||
whitesur-icon-theme
|
||||
whitesur-kde
|
||||
|
||||
@@ -282,7 +282,10 @@
|
||||
'';
|
||||
};
|
||||
bootMode = lib.mkOption {
|
||||
type = lib.types.enum [ "direct" "pxe" ];
|
||||
type = lib.types.enum [
|
||||
"direct"
|
||||
"pxe"
|
||||
];
|
||||
default = "direct";
|
||||
description = ''
|
||||
How the guest obtains its boot image.
|
||||
|
||||
@@ -91,8 +91,7 @@
|
||||
# В otreca аналогичный юнит определён в `modules/vds/default.nix` с
|
||||
# другим `PANEL_URL`/`apiToken`.
|
||||
systemd.services."3xui-reconfig" = {
|
||||
description =
|
||||
"Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
|
||||
description = "Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18).";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.getExe config.modules."3x-ui".reconfig;
|
||||
|
||||
@@ -208,11 +208,14 @@ in
|
||||
documentation = [ "https://github.com/oqyude/engipy" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
after = [ "network-online.target" "engipy-install.service" ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
"engipy-install.service"
|
||||
];
|
||||
wants = [ "network-online.target" ];
|
||||
requires = [ "engipy-install.service" ];
|
||||
|
||||
environment = {
|
||||
environment = {
|
||||
PYTHONUNBUFFERED = "1";
|
||||
PYTHONDONTWRITEBYTECODE = "1";
|
||||
VIRTUAL_ENV = "${cfg.dataDir}/venv";
|
||||
@@ -261,7 +264,8 @@ environment = {
|
||||
User = cfg.user;
|
||||
Group = cfg.user;
|
||||
WorkingDirectory = cfg.dataDir;
|
||||
ExecStart = "${cfg.dataDir}/venv/bin/uvicorn --factory app.main:create_app"
|
||||
ExecStart =
|
||||
"${cfg.dataDir}/venv/bin/uvicorn --factory app.main:create_app"
|
||||
+ " --host ${cfg.bindAddress} --port ${toString cfg.port} --no-access-log";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
@@ -279,7 +283,11 @@ environment = {
|
||||
RestrictRealtime = true;
|
||||
LockPersonality = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
"AF_UNIX"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,9 +18,9 @@ in
|
||||
# ----- Static user for the runner ----------------------------------------
|
||||
users.users.gitea-runner = {
|
||||
isSystemUser = true;
|
||||
group = "gitea-runner";
|
||||
home = "/var/lib/gitea-runner";
|
||||
description = "Gitea Actions Runner (sapphira host executor)";
|
||||
group = "gitea-runner";
|
||||
home = "/var/lib/gitea-runner";
|
||||
description = "Gitea Actions Runner (sapphira host executor)";
|
||||
};
|
||||
users.groups.gitea-runner = { };
|
||||
|
||||
@@ -39,21 +39,21 @@ in
|
||||
# decoded to a YAML body that EnvironmentFile could not parse, so
|
||||
# the runner received no $TOKEN at all and Gitea replied
|
||||
# "runner registration token not found".
|
||||
path = "/var/lib/gitea-runner/registration-token";
|
||||
format = "dotenv";
|
||||
path = "/var/lib/gitea-runner/registration-token";
|
||||
format = "dotenv";
|
||||
sopsFile = ../../secrets/gitea-runner-registration.env;
|
||||
owner = "gitea-runner";
|
||||
group = "gitea-runner";
|
||||
mode = "0440";
|
||||
owner = "gitea-runner";
|
||||
group = "gitea-runner";
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
# ----- The runner itself -------------------------------------------------
|
||||
services.gitea-actions-runner.instances."${name}" = {
|
||||
enable = true;
|
||||
name = name;
|
||||
url = "https://git.zeroq.su/"; # matches modules/server/gitea.nix ROOT_URL
|
||||
enable = true;
|
||||
name = name;
|
||||
url = "https://git.zeroq.su/"; # matches modules/server/gitea.nix ROOT_URL
|
||||
tokenFile = config.sops.secrets.gitea-runner-registration.path;
|
||||
labels = [ "native:host" ]; # only host-executor; no docker required
|
||||
labels = [ "native:host" ]; # only host-executor; no docker required
|
||||
|
||||
settings = {
|
||||
runner = {
|
||||
@@ -112,9 +112,9 @@ in
|
||||
# tmpfiles setup. We still add a tmpfiles rule for /tmp/gitea-runner-work
|
||||
# so successive deployments don't briefly see an empty target.
|
||||
systemd.tmpfiles.rules = xlib.helpers.mkTmpDirs {
|
||||
dir = "/tmp/gitea-runner-work";
|
||||
mode = "1777"; # sticky so different runner invocations don't clobber
|
||||
user = "root";
|
||||
dir = "/tmp/gitea-runner-work";
|
||||
mode = "1777"; # sticky so different runner invocations don't clobber
|
||||
user = "root";
|
||||
group = "root";
|
||||
};
|
||||
|
||||
|
||||
@@ -374,7 +374,7 @@ in
|
||||
# patch that reads X-Forwarded-Host (fork + plugin link) — the
|
||||
# same-origin check assumes direct loopback or Tailscale serve,
|
||||
# both of which give request.url a host that matches the browser.
|
||||
"herdr.zeroq.su" = {
|
||||
"herdr.zeroq.su" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations = {
|
||||
|
||||
+32
-17
@@ -137,8 +137,20 @@ let
|
||||
# realm = AD.ZEROQ.SU (realm Kerberos, верхний регистр)
|
||||
# dnsDomain = ad.zeroq.su (AD DNS-зона, нижний регистр)
|
||||
# Можно задать любой один, второй выводится.
|
||||
realm = if cfg.realm != null then lib.strings.toUpper cfg.realm else if cfg.dnsDomain != null then lib.strings.toUpper cfg.dnsDomain else null;
|
||||
dnsDomain = if cfg.dnsDomain != null then lib.strings.toLower cfg.dnsDomain else if cfg.realm != null then lib.strings.toLower cfg.realm else null;
|
||||
realm =
|
||||
if cfg.realm != null then
|
||||
lib.strings.toUpper cfg.realm
|
||||
else if cfg.dnsDomain != null then
|
||||
lib.strings.toUpper cfg.dnsDomain
|
||||
else
|
||||
null;
|
||||
dnsDomain =
|
||||
if cfg.dnsDomain != null then
|
||||
lib.strings.toLower cfg.dnsDomain
|
||||
else if cfg.realm != null then
|
||||
lib.strings.toLower cfg.realm
|
||||
else
|
||||
null;
|
||||
|
||||
# Заглушки на случай, когда не задано ни то, ни другое (закрыто assertion'ом).
|
||||
realmValue = if realm != null then realm else "<unset>";
|
||||
@@ -162,16 +174,22 @@ let
|
||||
cache directory = ${stateDir}/cache
|
||||
binddns dir = ${stateDir}/bind-dns
|
||||
idmap_ldb:use rfc2307 = yes
|
||||
${lib.optionalString (cfg.dnsBackend == "SAMBA_INTERNAL") ''
|
||||
dns port = ${toString cfg.dnsPort}
|
||||
''}${lib.optionalString (cfg.dnsForwarder != null) ''
|
||||
dns forwarder = ${cfg.dnsForwarder}
|
||||
''}${lib.optionalString (cfg.dnsBackend == "NONE") ''
|
||||
# dnsBackend = NONE: DC не поднимает DNS-сервер вовсе, порт 53 он
|
||||
# не трогает. Тогда AD-зоны должны обслуживать кто-то другой —
|
||||
# см. note-файл.
|
||||
server services = -dns
|
||||
''}
|
||||
${
|
||||
lib.optionalString (cfg.dnsBackend == "SAMBA_INTERNAL") ''
|
||||
dns port = ${toString cfg.dnsPort}
|
||||
''
|
||||
}${
|
||||
lib.optionalString (cfg.dnsForwarder != null) ''
|
||||
dns forwarder = ${cfg.dnsForwarder}
|
||||
''
|
||||
}${
|
||||
lib.optionalString (cfg.dnsBackend == "NONE") ''
|
||||
# dnsBackend = NONE: DC не поднимает DNS-сервер вовсе, порт 53 он
|
||||
# не трогает. Тогда AD-зоны должны обслуживать кто-то другой —
|
||||
# см. note-файл.
|
||||
server services = -dns
|
||||
''
|
||||
}
|
||||
[sysvol]
|
||||
path = ${sysvolPath}
|
||||
read only = no
|
||||
@@ -430,9 +448,7 @@ in
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
cfg.dnsBackend != "SAMBA_INTERNAL"
|
||||
|| cfg.dnsPort != 53
|
||||
|| !config.services.coredns.enable;
|
||||
cfg.dnsBackend != "SAMBA_INTERNAL" || cfg.dnsPort != 53 || !config.services.coredns.enable;
|
||||
message = ''
|
||||
host.samba-ad: КОНФЛИКТ ПОРТА 53. Встроенный DNS AD DC
|
||||
(dnsBackend = "SAMBA_INTERNAL", dnsPort = 53) и coredns оба хотят
|
||||
@@ -451,8 +467,7 @@ in
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
!(config.services.samba.enable && config.services.samba.smbd.enable);
|
||||
assertion = !(config.services.samba.enable && config.services.samba.smbd.enable);
|
||||
message = ''
|
||||
host.samba-ad: КОНФЛИКТ ПОРТА 445. AD DC обязан отдавать sysvol по
|
||||
SMB (без этого не работает групповая политика), поэтому DC занимает
|
||||
|
||||
@@ -58,7 +58,7 @@ in
|
||||
"force group" = "root";
|
||||
};
|
||||
"${xlib.device.username}" = {
|
||||
"path" = "${xlib.dirs.server-home}";
|
||||
"path" = "${xlib.dirs.user-home}";
|
||||
"browseable" = "yes";
|
||||
"read only" = "no";
|
||||
"valid users" = "${xlib.device.username}";
|
||||
|
||||
+29
-29
@@ -41,39 +41,39 @@ in
|
||||
# Generate the host key on first activation (idempotent).
|
||||
build.activation = {
|
||||
sshd = ''
|
||||
if [[ ! -d "${sshdDir}" ]]; then
|
||||
$DRY_RUN_CMD rm -rf "${sshdTmpDir}"
|
||||
$DRY_RUN_CMD mkdir -p "${sshdTmpDir}"
|
||||
$VERBOSE_ECHO "Generating sshd host key..."
|
||||
$DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f "${sshdTmpDir}/ssh_host_ed25519_key" -N ""
|
||||
$DRY_RUN_CMD mv "${sshdTmpDir}" "${sshdDir}"
|
||||
fi
|
||||
'';
|
||||
if [[ ! -d "${sshdDir}" ]]; then
|
||||
$DRY_RUN_CMD rm -rf "${sshdTmpDir}"
|
||||
$DRY_RUN_CMD mkdir -p "${sshdTmpDir}"
|
||||
$VERBOSE_ECHO "Generating sshd host key..."
|
||||
$DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f "${sshdTmpDir}/ssh_host_ed25519_key" -N ""
|
||||
$DRY_RUN_CMD mv "${sshdTmpDir}" "${sshdDir}"
|
||||
fi
|
||||
'';
|
||||
|
||||
# nix-on-droid's session-init adds ~/.nix-defexpr/channels to NIX_PATH
|
||||
# unconditionally; nix warns about the missing dir on every invocation.
|
||||
# Making it exist silences the warning. Must be done in activation (not
|
||||
# home-manager): ~/.nix-defexpr/channels is a symlink into
|
||||
# ~/.local/state/nix/profiles/channels (dangling until it exists), which
|
||||
# home-manager cannot link into. mkdir -p refuses to traverse a dangling
|
||||
# symlink, so create the real target dir instead.
|
||||
# nix-on-droid's session-init adds ~/.nix-defexpr/channels to NIX_PATH
|
||||
# unconditionally; nix warns about the missing dir on every invocation.
|
||||
# Making it exist silences the warning. Must be done in activation (not
|
||||
# home-manager): ~/.nix-defexpr/channels is a symlink into
|
||||
# ~/.local/state/nix/profiles/channels (dangling until it exists), which
|
||||
# home-manager cannot link into. mkdir -p refuses to traverse a dangling
|
||||
# symlink, so create the real target dir instead.
|
||||
nixdefexpr = ''
|
||||
$DRY_RUN_CMD mkdir -p "${config.user.home}/.local/state/nix/profiles/channels/nixpkgs"
|
||||
$DRY_RUN_CMD touch "${config.user.home}/.local/state/nix/profiles/channels/nixpkgs/.keep"
|
||||
'';
|
||||
$DRY_RUN_CMD mkdir -p "${config.user.home}/.local/state/nix/profiles/channels/nixpkgs"
|
||||
$DRY_RUN_CMD touch "${config.user.home}/.local/state/nix/profiles/channels/nixpkgs/.keep"
|
||||
'';
|
||||
|
||||
# runit service tree: ~/service/<name>/{run,log/run}. run/ and log/run are
|
||||
# symlinks into the nix store (read-only is fine; runsvdir writes only to
|
||||
# the <name>/supervise dirs). /etc/service is symlinked for `sv status`.
|
||||
# NOTE: tailscaled was removed — nixpkgs' linux build cannot run inside
|
||||
# proot (SELinux blocks netlink; needs GOOS=android or root). Re-add only
|
||||
# if that gets solved.
|
||||
# runit service tree: ~/service/<name>/{run,log/run}. run/ and log/run are
|
||||
# symlinks into the nix store (read-only is fine; runsvdir writes only to
|
||||
# the <name>/supervise dirs). /etc/service is symlinked for `sv status`.
|
||||
# NOTE: tailscaled was removed — nixpkgs' linux build cannot run inside
|
||||
# proot (SELinux blocks netlink; needs GOOS=android or root). Re-add only
|
||||
# if that gets solved.
|
||||
services = ''
|
||||
$DRY_RUN_CMD rm -rf ${serviceDir}/tailscaled
|
||||
$DRY_RUN_CMD mkdir -p ${serviceDir}/sshd/log
|
||||
$DRY_RUN_CMD ln -sfn ${sshdRun}/bin/sshd-run ${serviceDir}/sshd/run
|
||||
$DRY_RUN_CMD ln -sfn ${svLogRun}/bin/sv-log-run ${serviceDir}/sshd/log/run
|
||||
$DRY_RUN_CMD ln -sfn ${serviceDir} /etc/service
|
||||
$DRY_RUN_CMD rm -rf ${serviceDir}/tailscaled
|
||||
$DRY_RUN_CMD mkdir -p ${serviceDir}/sshd/log
|
||||
$DRY_RUN_CMD ln -sfn ${sshdRun}/bin/sshd-run ${serviceDir}/sshd/run
|
||||
$DRY_RUN_CMD ln -sfn ${svLogRun}/bin/sv-log-run ${serviceDir}/sshd/log/run
|
||||
$DRY_RUN_CMD ln -sfn ${serviceDir} /etc/service
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
# их по очереди; один из них адресует локальную панель, другой — удалённую,
|
||||
# и оба лечат одно и то же «сервер крутит старое».)
|
||||
systemd.services."3xui-reconfig" = {
|
||||
description =
|
||||
"Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18) — вариант для Otreca (публичный домен).";
|
||||
description = "Перегенерировать config.json 3x-ui из БД и рестартнуть xray (R1.18) — вариант для Otreca (публичный домен).";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.getExe config.modules."3x-ui".reconfig;
|
||||
|
||||
Reference in new issue
Block a user