create-vibe-maestro 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +33 -30
- package/dist/cli/create-run.js +74 -9
- package/dist/cli/create.js +21 -2
- package/dist/cli/doctor-run.js +2 -1
- package/dist/cli/prompt.js +12 -4
- package/dist/cli/renderer.js +5 -4
- package/dist/cli/upgrade-run.js +4 -0
- package/dist/core/doctor/git.js +41 -1
- package/dist/core/doctor/inbox.js +5 -11
- package/dist/core/doctor/sources.js +1 -1
- package/dist/core/github.js +107 -0
- package/dist/core/init.js +37 -10
- package/dist/core/inventory.js +4 -0
- package/dist/core/readme.js +21 -0
- package/dist/core/settings.js +39 -0
- package/dist/core/upgrade/analyze.js +61 -8
- package/dist/core/upgrade/baseline.js +4 -0
- package/dist/core/upgrade/releases.js +60 -10
- package/docs/ROADMAP.md +71 -44
- package/docs/USER_GUIDE.md +82 -58
- package/package.json +1 -1
- package/registry/baseline/0.4.1/project/.claude/commands/plan.md +2 -0
- package/registry/baseline/0.4.1/project/.claude/rules/maestro.md +35 -0
- package/registry/baseline/0.4.1/project/maestro/inbox/README.md +16 -0
- package/registry/baseline/0.4.1/project/maestro/runbooks/cowork-discovery.md +30 -0
- package/registry/baseline/0.4.1/project/protocols/discovery.md +5 -0
- package/registry/baseline/0.4.1/project/protocols/plan.md +142 -0
- package/registry/capabilities.v1.json +13 -1
- package/templates/project/.claude/commands/plan.md +1 -0
- package/templates/project/.claude/commands/start.md +2 -0
- package/templates/project/.claude/rules/maestro.md +5 -3
- package/templates/project/.claude/rules/project.md +6 -0
- package/templates/project/.claude/settings.json +2 -0
- package/templates/project/README.md +11 -0
- package/templates/project/maestro/inbox/README.md +6 -6
- package/templates/project/maestro/runbooks/cowork-discovery.md +1 -1
- package/templates/project/protocols/discovery.md +1 -3
- package/templates/project/protocols/plan.md +14 -7
- package/templates/project/protocols/start.md +64 -0
- package/templates/project/wiki/concepts/discovery.md +30 -11
- package/templates/project/wiki/hot.md +2 -2
- package/templates/project/wiki/index.md +1 -0
- package/templates/project/wiki/passport.md +2 -0
- package/templates/project/wiki/plans/0001-starter.md +4 -3
- package/templates/project/wiki/restore.md +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,43 @@ All notable changes to Vibe Coding Maestro are documented here.
|
|
|
4
4
|
|
|
5
5
|
The project follows Semantic Versioning while prerelease interfaces may still change between beta versions.
|
|
6
6
|
|
|
7
|
+
## 0.4.2 — 2026-11-01
|
|
8
|
+
|
|
9
|
+
The third part of 0.4: starting a project. One first step everywhere — create → `/start` → `/plan`; materials in one place, kept byte for byte; a private copy in the cloud from day one. The set of project files changes; `vibe-maestro upgrade` migrates projects from 0.4.1, 0.4.0, 0.3.1, 0.3.0, 0.3.0-beta.1 – beta.4 and 0.2.0-beta.1.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`/start` with its own protocol `protocols/start.md`** (managed, command `.claude/commands/start.md`). The first session reads what already exists — the starting point from `create --start`, materials in `maestro/inbox/` (large files through the `explorer` subagent), what the human said, code in another folder only read-only through `sources`, asking for the path. Then it asks one question at a time, in plain words: seven about the task (what we make; for whom; who gets the result — kept or handed to a customer, team, employer; what «done» means; what else exists; what we do not do; constraints — laws, platform rules, other people's personal data) and six about how we work (who decides and on whose behalf the agent may write; what only after a separate «да»; code right after plan approval or on «начинай»; how to talk; how to hand over keys; where the copy lives and how to restore), each with the agent's proposal as the default. Deadlines and budget are not asked; if named, they are written down. Found answers are shown with their source and a «верно?»; «не знаю» is recorded as UNKNOWN. A draft is kept in the project, so the human can stop and continue; `/start` can be run again to revise one agreement. A one-screen summary with the rhythm of slices, then writing only after «да»: the task to `wiki/concepts/discovery.md`, how we work to the «Как работаем» section of `.claude/rules/project.md` (other sections untouched), the copy and restore to `wiki/restore.md`, the cloud address to the passport. Protections in `settings.json` change only on a separate «да». `protocols/discovery.md` now points to the start; the capabilities `discovery-before-code` and new `project-start` live in `start.md`.
|
|
14
|
+
- **Start flag** `start:` in the `wiki/concepts/discovery.md` header: `not_started` → `in_progress` → `done`; `skipped` when the human declines. `protocols/plan.md` Stage A reads the start answers and does not ask again; if the start is not done it offers it once, and after a refusal asks only what the plan needs.
|
|
15
|
+
- **`wiki/restore.md`** (belongs to the project): what is in the cloud (address in the passport), what is not (`.env`, key values, personal settings), what to install, how to get the project, how to check it.
|
|
16
|
+
- **`README.md`** for a new project, only when the folder has no README of any name; it says the file is read first, also by the recipient, and asks to rewrite it. It is not in the inventory `doctor` checks and may be deleted.
|
|
17
|
+
- **A copy in the cloud from day one.** The wizard offers «Создать новый проект и закрытую копию на GitHub» as the last option of its first question, only when the GitHub CLI `gh` is installed and logged in (checked while the welcome is shown, 3 s timeout); still three decisions. For scripts: `create --github`. After the first commit: `gh repo create <name> --private --source <folder> --remote origin --push`; the name is Latin from the folder name (Cyrillic transliterated, empty → `project-YYYYMMDD`). Any `gh` failure is a warning with the command for later; the project stays and the exit code is 0. `--github` with `--no-git` is an error before writing.
|
|
18
|
+
- **`create --push-without-asking`** for new projects: `settings.json` gets the guide recipe — plain `git push` allowed; force pushes (`--force`, `-f`, `+branch`) and deleting in the cloud (`--delete`, `-d`, `--mirror`, `--prune`) still ask; one `ask` key. `.claude/rules/maestro.md` names this exception to «push only after a separate „да“».
|
|
19
|
+
- `doctor` `info` findings from local Git data only, no network: `git-no-remote`, `git-no-upstream`, `git-unpushed`. They do not fail `--strict` or `preflight`.
|
|
20
|
+
- `maestro/inbox/.gitattributes` (managed, `* -text`, written by code like the root `.gitattributes`): Git keeps materials byte for byte, a fresh clone returns the original bytes on any `core.autocrlf`.
|
|
21
|
+
- Rules for everyone in `.claude/rules/maestro.md`: check a person's proposal against what already exists and say so if it is not needed or done; plain words, a technical term only with its meaning. «Выбор навыков» in `protocols/plan.md`: installed, GitHub and official Anthropic catalogs; compare several, check `SKILL.md`, `allowed-tools`, hooks; pick the best; install only after «да». Maestro installs nothing itself.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- One first step in five places — the create screen, `wiki/hot.md`, `wiki/plans/0001-starter.md`, `.claude/rules/maestro.md`, the README — and in the user guide: create → `/start` → `/plan`. Section names of `wiki/hot.md` are unchanged.
|
|
26
|
+
- **Materials without a red check.** `inbox-not-empty` is removed: files in `maestro/inbox/` are not a finding, even with `--strict`. `source-hashes-missing` (still critical) now says that `maestro/sources/` holds only `sources --write` snapshots and points to `maestro/inbox/`. The create screen, `maestro/inbox/README.md` and `protocols/plan.md` say the same.
|
|
27
|
+
- `maestro/runbooks/cowork-discovery.md` no longer says Claude Code does not rewrite discovery: Cowork prepares material for `maestro/inbox/`, `/start` writes the answers.
|
|
28
|
+
- The passport template says it goes to the recipient in `HANDOVER.md` and should be written for them.
|
|
29
|
+
- The `vibe-maestro` companion package (0.1.6) depends on exactly `create-vibe-maestro@0.4.2`.
|
|
30
|
+
- Upgrade tests use projects generated by the real published 0.4.1 package.
|
|
31
|
+
|
|
32
|
+
### For those who create projects with their own scripts
|
|
33
|
+
|
|
34
|
+
- **Place for materials** — `maestro/inbox/`. Files there no longer give `inbox-not-empty` (it is gone). `maestro/sources/` is only for `vibe-maestro sources --write` snapshots; your own files there are still critical (`source-hashes-missing`).
|
|
35
|
+
- **The `-text` rule.** `create` and `upgrade` write `maestro/inbox/.gitattributes` with `* -text`: Git does not change line endings, a fresh clone returns the original bytes. Your own folder for other people's files — put the same `.gitattributes` there. Materials that were committed before the rule are not re-read by Git on their own: run `git add --renormalize maestro/inbox` and commit (checked on Git 2.54: a file Git has already seen is not shown as modified after the rule appears). If a file was already normalized (for example, taken from a fresh clone on another computer), the original bytes exist only in its source.
|
|
36
|
+
- **The start flag** — `start: done` in the `wiki/concepts/discovery.md` header. Set it right after `create`, and `/plan` will not offer the start. Values: `not_started`, `in_progress`, `done`, `skipped`. No field = not done.
|
|
37
|
+
- **Section names of `wiki/hot.md` do not change:** «Сейчас в работе», «Открытые вопросы», «Следующий шаг». Only the text inside changes for new projects.
|
|
38
|
+
- **`create --yes` creates no repository.** A private GitHub repository only with `--github`; push without asking only with `--push-without-asking`. Neither flag acts on a repeated `create` of an existing project.
|
|
39
|
+
- **New project files:** `protocols/start.md`, `.claude/commands/start.md`, `maestro/inbox/.gitattributes` (Maestro); `wiki/restore.md` (project). `README.md` only when the root has no README; `doctor` does not require it.
|
|
40
|
+
- **`doctor`:** new findings `git-no-remote`, `git-no-upstream`, `git-unpushed` are `info` and block neither `--strict` nor `preflight`.
|
|
41
|
+
- **Your own `.claude/commands/start.md`** stops `upgrade` with a clear message: rename it (for example, to `my-start.md`) and run again.
|
|
42
|
+
- **Projects before 0.4.2:** `.claude/settings.json` belongs to the project and `upgrade` does not change it — add `Edit(/.claude/commands/start.md)` and `Edit(/maestro/inbox/.gitattributes)` to `deny` if you want the same protection.
|
|
43
|
+
|
|
7
44
|
## 0.4.1 — 2026-10-31
|
|
8
45
|
|
|
9
46
|
The second part of 0.4: packing a project for the customer and measuring the session. The set of project files is unchanged; `upgrade` from 0.4.0 rewrites the pinned version, `.claude/rules/maestro.md`, `protocols/handoff.md` and `protocols/completion.md`.
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT]
|
|
28
|
-
> **0.4.
|
|
28
|
+
> **0.4.2 is published on npm.** Create a project with `npx create-vibe-maestro@latest`. Every generated project records the exact Maestro version in `.claude/rules/maestro.md`, so its checks do not change under it when a new version is published; `vibe-maestro upgrade` moves it forward when you decide. Interfaces may still change before 1.0. The CLI and generated project templates are Russian-first; English localization is planned before a global release.
|
|
29
29
|
|
|
30
30
|
When an AI-assisted project lasts longer than one chat, the same problems keep returning:
|
|
31
31
|
|
|
@@ -47,15 +47,13 @@ The recording shows the create-and-`doctor` surface of an earlier beta; the Plan
|
|
|
47
47
|
|
|
48
48
|
## Quick start
|
|
49
49
|
|
|
50
|
-
**Requirements:** Node.js 20.10 or newer, npm, and Git. Nothing to clone or build.
|
|
51
|
-
|
|
52
|
-
Run the guided setup:
|
|
50
|
+
**Requirements:** Node.js 20.10 or newer, npm, and Git. Nothing to clone or build. Run the guided setup:
|
|
53
51
|
|
|
54
52
|
```bash
|
|
55
53
|
npx create-vibe-maestro@latest
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
The Guided First Run explains where files will be created and asks for no more than three decisions. A simple project name creates the folder on your Desktop; an explicit path always wins. Set `NO_COLOR=1` if you need plain output.
|
|
56
|
+
The Guided First Run explains where files will be created and asks for no more than three decisions. A simple project name creates the folder on your Desktop; an explicit path always wins. When the GitHub CLI (`gh`) is installed and you are logged in, the first question also offers «Создать новый проект и закрытую копию на GitHub». Set `NO_COLOR=1` if you need plain output.
|
|
59
57
|
|
|
60
58
|
Or pass every decision explicitly:
|
|
61
59
|
|
|
@@ -63,7 +61,7 @@ Or pass every decision explicitly:
|
|
|
63
61
|
npx create-vibe-maestro@latest --yes --target "My Project" --name "My Project" --start idea --depth standard
|
|
64
62
|
```
|
|
65
63
|
|
|
66
|
-
Maestro creates the project, initializes Git on `main`, makes the initial commit, and runs `doctor`. To check it again later, open the project folder and run the command written in its `.claude/rules/maestro.md` (it names the exact version the project uses):
|
|
64
|
+
Maestro creates the project, initializes Git on `main`, makes the initial commit, and runs `doctor`. Two optional flags for scripts: `--github` creates a private GitHub repository after the first commit (`gh repo create … --private --source … --remote origin --push`; any `gh` failure is only a warning with the command for later), and `--push-without-asking` lets the agent run a plain `git push` without a question while force pushes still ask. Without them `create --yes` creates no repository and keeps the default protections. To check it again later, open the project folder and run the command written in its `.claude/rules/maestro.md` (it names the exact version the project uses):
|
|
67
65
|
|
|
68
66
|
```bash
|
|
69
67
|
cd "My Project"
|
|
@@ -74,34 +72,36 @@ Expected result:
|
|
|
74
72
|
|
|
75
73
|
```text
|
|
76
74
|
Vibe Coding Maestro doctor: всё сходится.
|
|
75
|
+
- git-no-remote: Копии проекта в облаке нет: у репозитория нет remote. …
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
`@latest` above is the newest published Maestro. If it is newer than your project, `doctor` says so and prints the exact commands to check the project with its own version or to upgrade it.
|
|
78
|
+
The second line is `info` (from local Git data only; it never fails `doctor`, `--strict` or `preflight`) and disappears once the project has a copy in the cloud. `@latest` above is the newest published Maestro. If it is newer than your project, `doctor` says so and prints the exact commands to check the project with its own version or to upgrade it.
|
|
80
79
|
|
|
81
80
|
> [!WARNING]
|
|
82
|
-
> **Core 0.3 creates new canonical projects only.** It can also re-check a complete project already created by the same canonical engine, and `vibe-maestro upgrade` can evolve a provably canonical project created by an earlier published version (0.2.0-beta.1, 0.3.0-beta.1 – 0.3.0-beta.4, 0.3.0). It refuses to modify a non-empty, non-canonical directory, and no flag overrides that refusal. Safe conversion of arbitrary existing projects belongs to a separate future Converter.
|
|
81
|
+
> **Core 0.3 creates new canonical projects only.** It can also re-check a complete project already created by the same canonical engine, and `vibe-maestro upgrade` can evolve a provably canonical project created by an earlier published version (0.2.0-beta.1, 0.3.0-beta.1 – 0.3.0-beta.4, 0.3.0, 0.3.1, 0.4.0, 0.4.1). It refuses to modify a non-empty, non-canonical directory, and no flag overrides that refusal. Safe conversion of arbitrary existing projects belongs to a separate future Converter.
|
|
83
82
|
|
|
84
83
|
## Что дальше после создания проекта: Planning Gate
|
|
85
84
|
|
|
86
|
-
Проект создан — **откройте созданную папку** (`My Project`) в Claude Code
|
|
85
|
+
Проект создан — **откройте созданную папку** (`My Project`) в Claude Code. Первый шаг один: `/start`, потом `/plan`. Дальше работа идёт по одному маршруту: сначала план, который утверждает человек, и только потом код.
|
|
87
86
|
|
|
88
87
|
```text
|
|
89
|
-
|
|
88
|
+
создание → /start → /plan → классификация → черновик плана
|
|
90
89
|
→ человек утверждает → preflight → /build одной порции → тесты и doctor → /handoff
|
|
91
90
|
```
|
|
92
91
|
|
|
93
|
-
1.
|
|
94
|
-
2.
|
|
95
|
-
3.
|
|
96
|
-
4.
|
|
97
|
-
5.
|
|
98
|
-
6.
|
|
99
|
-
7.
|
|
100
|
-
8.
|
|
92
|
+
1. **Материалы**, если есть, — заметки, требования, скриншоты — положите в `maestro/inbox/`. Готовый код оставьте, где лежит: `/start` спросит путь и прочитает его только на чтение.
|
|
93
|
+
2. **Напишите `/start`** — знакомство с задачей. Агент сначала читает, что уже есть, потом спрашивает по одному вопросу: о задаче (что делаем, для кого, кому отдаём результат, что значит «готово», что ещё есть, чего не делаем, ограничения) и о том, как работаем (кто решает, что только после вашего «да», когда начинать код, как говорить, как отдавать ключи, где копия проекта). «Не знаю» — нормальный ответ. Можно прерваться и продолжить. После вашего «да» на сводку ответы записываются в проект. Агент без команд (Codex и другие) проходит старт по `protocols/start.md`.
|
|
94
|
+
3. **Попросите план.** В Claude Code это команда `/plan`, в Cowork — фраза «план» по runbook `maestro/runbooks/cowork-plan.md`. Это две разные двери в один и тот же канонический `protocols/plan.md`. План не переспрашивает ответы старта.
|
|
95
|
+
4. **Проверьте классификацию.** Агент называет масштаб, режим, глубину гарантий, риск и профили с причинами. Вы можете принять её, изменить или сузить объём.
|
|
96
|
+
5. **Покажите существующий код**, если он есть: команда `sources` читает его read-only и по умолчанию ничего не пишет.
|
|
97
|
+
6. **Получите черновик** в `wiki/plans/<номер>-<слаг>.md`. Пока он `draft`, гейт показывает `CODE_ALLOWED: NO`.
|
|
98
|
+
7. **Утвердите план сами** — словами «план утверждаю». После этих слов агент сам записывает поля плана, объявляет его в `wiki/hot.md` и ставит отпечаток утверждения: если текст плана потом изменится, `doctor` и `preflight` это заметят. Maestro не может механически отличить, кто заполнил поля — человек или агент: следите, чтобы они появлялись только после ваших слов.
|
|
99
|
+
8. **Проверьте право на код** механическим гейтом `preflight` (команды ниже).
|
|
100
|
+
9. **`/build` ровно одной порции — лучше в новой сессии** → тесты → `doctor` → `/handoff`. Агент правит только файлы из раздела плана «Где правим».
|
|
101
101
|
|
|
102
102
|
### Откуда запускать команды
|
|
103
103
|
|
|
104
|
-
- `/plan`, `/build`, `/status`, `/wiki`, `/handoff` — внутри **папки проекта**, открытой в Claude Code.
|
|
104
|
+
- `/start`, `/plan`, `/build`, `/status`, `/wiki`, `/handoff` — внутри **папки проекта**, открытой в Claude Code.
|
|
105
105
|
- `doctor`, `preflight`, `sources`, `upgrade` — тоже из **папки проекта**, через `npx`, с `--path .`. Точная команда с версией вашего проекта записана в его `.claude/rules/maestro.md`; ниже — общая форма:
|
|
106
106
|
|
|
107
107
|
```bash
|
|
@@ -143,13 +143,14 @@ A Standard project starts with a structure like this:
|
|
|
143
143
|
My Project/
|
|
144
144
|
├── AGENTS.md # yours: entry for Codex and other AGENTS.md tools
|
|
145
145
|
├── CLAUDE.md # yours: project instructions for Claude Code
|
|
146
|
+
├── README.md # yours: only when the folder had no README; rewrite it for your reader
|
|
146
147
|
├── .claude/rules/ # maestro.md (Maestro rules, loaded every session) + project.md (yours)
|
|
147
148
|
├── .claude/settings.json # yours: default deny/ask rules (Maestro files, push, publish)
|
|
148
|
-
├── .claude/commands/ # /status, /plan, /build, /wiki, /handoff adapters
|
|
149
|
+
├── .claude/commands/ # /start, /status, /plan, /build, /wiki, /handoff adapters
|
|
149
150
|
├── .claude/agents/ # read-only code-reviewer and explorer
|
|
150
151
|
├── protocols/ # canonical rules for planning, building, handoff and project completion
|
|
151
|
-
├── wiki/ # shared memory: plans, decisions, progress, audits
|
|
152
|
-
├── maestro/ # inbox
|
|
152
|
+
├── wiki/ # shared memory: start answers, plans, decisions, progress, audits, passport, restore page
|
|
153
|
+
├── maestro/ # inbox for your materials (kept byte for byte), runbooks, and templates
|
|
153
154
|
└── .maestro/ # manifest, ownership inventory and integrity metadata
|
|
154
155
|
```
|
|
155
156
|
|
|
@@ -177,10 +178,11 @@ From there, `protocols/build.md` routes the agent through the relevant rules, pl
|
|
|
177
178
|
|
|
178
179
|
## A normal working cycle
|
|
179
180
|
|
|
180
|
-
The guided path above is the whole cycle: material in `maestro/inbox/` → plan → human approval → one bounded build with tests and live evidence → `doctor` → handoff, then a new session for the next slice (`vibe-maestro context` tells the agent how large the session has grown). When the last slice is done, `protocols/completion.md` walks through delivery or closing: criteria checked, tests green, a delivery tag, a complete project passport (`wiki/passport.md`: where everything lives, names of environment variables but never their values), customer documents, a final handoff; `vibe-maestro pack` builds the customer archive from the delivery tag. Independent audit findings are recorded with stable IDs; open `high` or `critical` findings block a green doctor result.
|
|
181
|
+
The guided path above is the whole cycle: material in `maestro/inbox/` → `/start` (getting to know the task) → plan → human approval → one bounded build with tests and live evidence → `doctor` → handoff, then a new session for the next slice (`vibe-maestro context` tells the agent how large the session has grown). When the last slice is done, `protocols/completion.md` walks through delivery or closing: criteria checked, tests green, a delivery tag, a complete project passport (`wiki/passport.md`: where everything lives, names of environment variables but never their values), customer documents, a final handoff; `vibe-maestro pack` builds the customer archive from the delivery tag. Independent audit findings are recorded with stable IDs; open `high` or `critical` findings block a green doctor result.
|
|
181
182
|
|
|
182
|
-
Claude Code projects receive
|
|
183
|
+
Claude Code projects receive six thin commands:
|
|
183
184
|
|
|
185
|
+
- `/start` — the first session: read what already exists, then agree on the task and on how we work, one question at a time;
|
|
184
186
|
- `/status` — read current context without changing files;
|
|
185
187
|
- `/plan` — follow the canonical planning protocol up to the human approval gate;
|
|
186
188
|
- `/build` — follow the canonical build protocol;
|
|
@@ -252,7 +254,7 @@ The core format is vendor-neutral; integration depth is not identical across too
|
|
|
252
254
|
| Interface | Level in 0.3 | What is available |
|
|
253
255
|
|---|---|---|
|
|
254
256
|
| Humans | Native | Plain Markdown, Git diffs, explicit ownership, runbooks |
|
|
255
|
-
| Claude Code | Native adapter | `.claude/rules/` loaded every session,
|
|
257
|
+
| Claude Code | Native adapter | `.claude/rules/` loaded every session, six project commands including `/start` and `/plan`, read-only reviewer and explorer, default `settings.json` |
|
|
256
258
|
| Codex and other `AGENTS.md` tools | Generic adapter | Universal `AGENTS.md` entry into canonical protocols |
|
|
257
259
|
| Cursor and other filesystem-aware tools | Generic | They can read the same Markdown; no dedicated adapter yet |
|
|
258
260
|
| Cowork-style research/audit | Runbook | Copyable plan, discovery, and independent-audit workflows; human imports the result |
|
|
@@ -269,7 +271,7 @@ Run the preview from the project folder; it writes nothing:
|
|
|
269
271
|
npx --package create-vibe-maestro@latest vibe-maestro upgrade --path .
|
|
270
272
|
```
|
|
271
273
|
|
|
272
|
-
It lists every file it would add or update and prints the exact command, with the exact version, that applies the change (`--apply`). A file you edited by hand is never overwritten: the upgrade stops and names it. After applying, add all changes to Git including the new files (`git add -A`), review and commit them — until then `doctor` reports the uncommitted and untracked Maestro files — then run `doctor --strict` with the same version.
|
|
274
|
+
It lists every file it would add or update and prints the exact command, with the exact version, that applies the change (`--apply`). A file you edited by hand is never overwritten: the upgrade stops and names it. Moving to 0.4.2 adds the `/start` command and protocol, `maestro/inbox/.gitattributes` and `wiki/restore.md`, and a `README.md` only if the project has no README of any name; if materials already sit in `maestro/inbox/`, run `git add --renormalize maestro/inbox` before committing so Git keeps them byte for byte. After applying, add all changes to Git including the new files (`git add -A`), review and commit them — until then `doctor` reports the uncommitted and untracked Maestro files — then run `doctor --strict` with the same version.
|
|
273
275
|
|
|
274
276
|
## Automation and CI
|
|
275
277
|
|
|
@@ -292,14 +294,15 @@ npx --package create-vibe-maestro@latest vibe-maestro upgrade --path .
|
|
|
292
294
|
|
|
293
295
|
`preflight` and `doctor` exit `0` when the check passes and `1` when it blocks; `sources` and `upgrade` write nothing at all unless you add `--write` or `--apply`.
|
|
294
296
|
|
|
295
|
-
The repository release gate covers tests, type checking, build, audit, source acceptance, packed-tarball installation, all three depths, paths with spaces, deterministic doctor JSON, protocol drift, canonical identity forgery, incomplete canonical trees, forbidden audit waivers, symlink boundaries, and upgrades from projects created by the published 0.3 betas. Pull requests and `main` run on Ubuntu, macOS, and Windows with Node.js 20 and 22; a branch push runs one quick Ubuntu job.
|
|
297
|
+
The repository release gate covers tests, type checking, build, audit, source acceptance, packed-tarball installation, all three depths, paths with spaces, deterministic doctor JSON, protocol drift, canonical identity forgery, incomplete canonical trees, forbidden audit waivers, symlink boundaries, and upgrades from projects created by the published 0.3 betas, 0.3.x, 0.4.0 and 0.4.1. Pull requests and `main` run on Ubuntu, macOS, and Windows with Node.js 20 and 22; a branch push runs one quick Ubuntu job.
|
|
296
298
|
|
|
297
299
|
## Current scope
|
|
298
300
|
|
|
299
301
|
Available now:
|
|
300
302
|
|
|
301
|
-
- Guided First Run;
|
|
302
|
-
- fresh canonical project creation;
|
|
303
|
+
- Guided First Run, with an optional private GitHub copy when `gh` is logged in;
|
|
304
|
+
- fresh canonical project creation, then `/start`: the first session reads what exists and agrees on the task and on how we work, one question at a time;
|
|
305
|
+
- `maestro/inbox/` as the one place for materials, kept byte for byte by Git;
|
|
303
306
|
- Planning Gate: `/plan`, Cowork plan runbook, project plans, and the human approval gate;
|
|
304
307
|
- mechanical `preflight` before the first line of code;
|
|
305
308
|
- read-only `sources` inventory of existing code;
|
|
@@ -327,7 +330,7 @@ Not available yet:
|
|
|
327
330
|
- automatic installation or execution of third-party skills;
|
|
328
331
|
- a guarantee that an AI agent will not make mistakes.
|
|
329
332
|
|
|
330
|
-
What comes next — a
|
|
333
|
+
What comes next — checks with a cutoff, one set of labels, and project memory that does not grow — is listed in the [roadmap](docs/ROADMAP.md).
|
|
331
334
|
|
|
332
335
|
## Documentation
|
|
333
336
|
|
package/dist/cli/create-run.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
1
2
|
import { basename } from 'node:path';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
2
4
|
import { doctorProject } from '../core/doctor.js';
|
|
3
5
|
import { describeFsError } from '../core/fs-errors.js';
|
|
6
|
+
import { createGithubCopy, displayRemoteUrl, githubCreateCommand, githubRepoName } from '../core/github.js';
|
|
4
7
|
import { initProject } from '../core/init.js';
|
|
8
|
+
import { onDiskBasename } from '../core/platform-paths.js';
|
|
5
9
|
import { EXIT_FAILED, EXIT_OK } from './io.js';
|
|
6
|
-
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
export async function executeCreate(options, io, renderer, gh) {
|
|
7
12
|
try {
|
|
8
|
-
return await createAndCheck(options, io, renderer);
|
|
13
|
+
return await createAndCheck(options, io, renderer, gh);
|
|
9
14
|
}
|
|
10
15
|
catch (cause) {
|
|
11
16
|
// initProject сам переводит ошибки записи; сюда доходит только непредвиденное.
|
|
@@ -19,12 +24,60 @@ export async function executeCreate(options, io, renderer) {
|
|
|
19
24
|
return EXIT_FAILED;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
|
-
async function
|
|
27
|
+
async function hasRemote(root) {
|
|
28
|
+
const remotes = await execFileAsync('git', ['remote'], { cwd: root, encoding: 'utf8' }).catch(() => null);
|
|
29
|
+
return remotes !== null && remotes.stdout.trim() !== '';
|
|
30
|
+
}
|
|
31
|
+
/** Адрес копии в облаке по локальным данным Git: origin, иначе первый remote; нет — null. */
|
|
32
|
+
async function remoteUrl(root) {
|
|
33
|
+
const remotes = await execFileAsync('git', ['remote'], { cwd: root, encoding: 'utf8' }).catch(() => null);
|
|
34
|
+
const names = (remotes?.stdout ?? '').split(/\r?\n/).filter(Boolean);
|
|
35
|
+
const name = names.includes('origin') ? 'origin' : names[0];
|
|
36
|
+
if (name === undefined)
|
|
37
|
+
return null;
|
|
38
|
+
const url = await execFileAsync('git', ['remote', 'get-url', name], { cwd: root, encoding: 'utf8' }).catch(() => null);
|
|
39
|
+
const shown = url?.stdout.trim();
|
|
40
|
+
return shown ? displayRemoteUrl(shown) : null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Копия на GitHub — только для проекта, чей репозиторий и первый коммит сделал этот create.
|
|
44
|
+
* Сбой gh не отменяет созданный проект: человек получает причину и команду на потом.
|
|
45
|
+
*/
|
|
46
|
+
async function cloudStep(options, result, gh) {
|
|
47
|
+
if (options.github !== true)
|
|
48
|
+
return { status: 'none' };
|
|
49
|
+
if (result.existingProject === true) {
|
|
50
|
+
return {
|
|
51
|
+
status: 'skipped',
|
|
52
|
+
reason: (await hasRemote(result.target))
|
|
53
|
+
? 'Копию на GitHub не завожу: это готовый проект, и копия в облаке (remote) у него уже есть. Create не меняет готовый проект.'
|
|
54
|
+
: 'Копию на GitHub не завожу: create не меняет готовый проект. Завести копию в облаке поможет `/start`.',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const name = githubRepoName(onDiskBasename(result.target));
|
|
58
|
+
if (result.gitCreated !== true) {
|
|
59
|
+
return {
|
|
60
|
+
status: 'skipped',
|
|
61
|
+
reason: `Копию на GitHub не завожу: первый коммит не сделан (репозиторий Git уже был или шаги Git пропущены). Когда коммит будет, из папки проекта: ${githubCreateCommand(name)}`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const copy = await createGithubCopy(result.target, name, gh);
|
|
65
|
+
if (copy.ok)
|
|
66
|
+
return { status: 'created', url: copy.url };
|
|
67
|
+
// Репозиторий мог успеть появиться, а отправка — нет: тогда нужна только отправка.
|
|
68
|
+
const later = (await hasRemote(result.target)) ? 'git push -u origin main' : githubCreateCommand(name);
|
|
69
|
+
return { status: 'failed', reason: copy.reason, later };
|
|
70
|
+
}
|
|
71
|
+
function cloudLine(url) {
|
|
72
|
+
return url !== null ? `Копия в облаке: ${url}` : 'Копии в облаке нет — завести её поможет /start.';
|
|
73
|
+
}
|
|
74
|
+
async function createAndCheck(options, io, renderer, gh) {
|
|
23
75
|
const result = await initProject({
|
|
24
76
|
target: options.target,
|
|
25
77
|
startingPoint: options.startingPoint,
|
|
26
78
|
git: options.git,
|
|
27
79
|
depth: options.depth,
|
|
80
|
+
...(options.pushWithoutAsking === true ? { pushWithoutAsking: true } : {}),
|
|
28
81
|
requested: {
|
|
29
82
|
...(options.explicit?.depth === true ? { depth: options.depth } : {}),
|
|
30
83
|
...(options.explicit?.startingPoint === true ? { startingPoint: options.startingPoint } : {}),
|
|
@@ -40,15 +93,25 @@ async function createAndCheck(options, io, renderer) {
|
|
|
40
93
|
io.err(result.error ?? 'Не удалось подготовить проект.');
|
|
41
94
|
return EXIT_FAILED;
|
|
42
95
|
}
|
|
96
|
+
const cloud = await cloudStep(options, result, gh);
|
|
97
|
+
const warnings = [...result.warnings];
|
|
98
|
+
if (cloud.status === 'skipped')
|
|
99
|
+
warnings.push(cloud.reason);
|
|
100
|
+
if (cloud.status === 'failed')
|
|
101
|
+
warnings.push(`Копию на GitHub завести не удалось: ${cloud.reason}. Проект создан и работает на этом компьютере. Повторить можно из папки проекта: ${cloud.later}`);
|
|
102
|
+
// Строка о копии — по фактическому remote: у готового проекта копия могла появиться раньше.
|
|
103
|
+
const cloudUrl = cloud.status === 'created' ? cloud.url : await remoteUrl(result.target);
|
|
43
104
|
const report = await doctorProject(result.target);
|
|
44
|
-
|
|
105
|
+
// Пометки info — не проблемы.
|
|
106
|
+
const problems = report.findings.filter((item) => item.level !== 'info').length;
|
|
107
|
+
const output = { init: result, ...(options.github === true ? { github: cloud } : {}), doctor: report };
|
|
45
108
|
if (options.json) {
|
|
46
109
|
io.out(JSON.stringify(output, null, 2));
|
|
47
110
|
}
|
|
48
111
|
else {
|
|
49
112
|
if (!renderer)
|
|
50
113
|
io.out(`Проект подготовлен: ${result.target}`);
|
|
51
|
-
for (const warning of
|
|
114
|
+
for (const warning of warnings) {
|
|
52
115
|
if (renderer)
|
|
53
116
|
renderer.warning(warning);
|
|
54
117
|
else
|
|
@@ -56,12 +119,14 @@ async function createAndCheck(options, io, renderer) {
|
|
|
56
119
|
}
|
|
57
120
|
if (renderer) {
|
|
58
121
|
if (report.ok)
|
|
59
|
-
renderer.success({ action: 'create', target: result.target, name: options.name ?? basename(result.target), doctorOk: true });
|
|
122
|
+
renderer.success({ action: 'create', target: result.target, name: options.name ?? basename(result.target), doctorOk: true, cloud: cloudUrl });
|
|
60
123
|
else
|
|
61
|
-
renderer.failure(`Проверка нашла проблем: ${
|
|
124
|
+
renderer.failure(`Проверка нашла проблем: ${problems}.`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
io.out(cloudLine(cloudUrl));
|
|
128
|
+
io.out(report.ok ? 'Doctor: всё сходится.' : `Doctor: найдено проблем — ${problems}.`);
|
|
62
129
|
}
|
|
63
|
-
else
|
|
64
|
-
io.out(report.ok ? 'Doctor: всё сходится.' : `Doctor: найдено проблем — ${report.findings.length}.`);
|
|
65
130
|
}
|
|
66
131
|
return report.ok ? EXIT_OK : EXIT_FAILED;
|
|
67
132
|
}
|
package/dist/cli/create.js
CHANGED
|
@@ -12,6 +12,10 @@ const HELP = `${PRODUCT_NAME} — подготовка проекта одной
|
|
|
12
12
|
--start <состояние> исходное состояние идеи: ${STARTING_POINTS.join(' | ')} (по умолчанию idea)
|
|
13
13
|
--depth <глубина> canonical depth: ${DEPTHS.join(' | ')} (по умолчанию standard)
|
|
14
14
|
--no-git не выполнять git init и стартовый commit
|
|
15
|
+
--github после первого коммита завести закрытую копию на GitHub
|
|
16
|
+
(нужны GitHub CLI gh и выполненный вход; без флага --yes её не заводит)
|
|
17
|
+
--push-without-asking новый проект: обычный git push без вопроса, принудительная отправка
|
|
18
|
+
по-прежнему с вопросом; без флага защиты прежние
|
|
15
19
|
--yes, -y неинтерактивный режим (все ответы взяты из флагов)
|
|
16
20
|
--json машиночитаемый отчёт
|
|
17
21
|
--help, -h эта справка
|
|
@@ -26,6 +30,8 @@ export function parseCreateArgs(argv) {
|
|
|
26
30
|
git: true,
|
|
27
31
|
json: false,
|
|
28
32
|
depth: 'standard',
|
|
33
|
+
github: false,
|
|
34
|
+
pushWithoutAsking: false,
|
|
29
35
|
explicit: {},
|
|
30
36
|
};
|
|
31
37
|
for (let i = 0; i < argv.length; i += 1) {
|
|
@@ -40,6 +46,12 @@ export function parseCreateArgs(argv) {
|
|
|
40
46
|
case '--no-git':
|
|
41
47
|
options.git = false;
|
|
42
48
|
break;
|
|
49
|
+
case '--github':
|
|
50
|
+
options.github = true;
|
|
51
|
+
break;
|
|
52
|
+
case '--push-without-asking':
|
|
53
|
+
options.pushWithoutAsking = true;
|
|
54
|
+
break;
|
|
43
55
|
case '--yes':
|
|
44
56
|
case '-y':
|
|
45
57
|
break;
|
|
@@ -89,6 +101,12 @@ export function parseCreateArgs(argv) {
|
|
|
89
101
|
return { kind: 'error', message: `Лишний аргумент: ${arg}` };
|
|
90
102
|
}
|
|
91
103
|
}
|
|
104
|
+
if (options.github && !options.git) {
|
|
105
|
+
return {
|
|
106
|
+
kind: 'error',
|
|
107
|
+
message: 'Флаг --github отправляет на GitHub первый коммит, а --no-git отключает Git: оставьте один из них. Проект не создан.',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
92
110
|
if (options.target === '') {
|
|
93
111
|
return {
|
|
94
112
|
kind: 'error',
|
|
@@ -143,7 +161,8 @@ export async function runCreateCli(argv, io = processIo, runtime = { isTty: Bool
|
|
|
143
161
|
git: true,
|
|
144
162
|
json: false,
|
|
145
163
|
depth: 'standard',
|
|
146
|
-
|
|
164
|
+
github: answers.github,
|
|
165
|
+
}, io, prompt.renderer, runtime.gh);
|
|
147
166
|
}
|
|
148
167
|
catch (error) {
|
|
149
168
|
io.err(error instanceof Error ? error.message : 'Интерактивный ввод прерван.');
|
|
@@ -155,5 +174,5 @@ export async function runCreateCli(argv, io = processIo, runtime = { isTty: Bool
|
|
|
155
174
|
return EXIT_USAGE;
|
|
156
175
|
}
|
|
157
176
|
const { executeCreate } = await import('./create-run.js');
|
|
158
|
-
return executeCreate(parsed.options, io);
|
|
177
|
+
return executeCreate(parsed.options, io, undefined, runtime.gh);
|
|
159
178
|
}
|
package/dist/cli/doctor-run.js
CHANGED
|
@@ -13,7 +13,8 @@ export async function executeDoctorCommand(options, io) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
|
|
16
|
+
// Пометки info — не проблемы: в числе их нет, но в списке они видны.
|
|
17
|
+
io.err(`Vibe Coding Maestro doctor: найдено проблем — ${report.findings.filter((item) => item.level !== 'info').length}.`);
|
|
17
18
|
for (const item of report.findings) {
|
|
18
19
|
io.err(`- ${item.code}${item.path ? ` (${item.path})` : ''}: ${item.message}`);
|
|
19
20
|
}
|
package/dist/cli/prompt.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createInterface } from 'node:readline';
|
|
2
|
+
import { githubReady } from '../core/github.js';
|
|
2
3
|
import { resolveProjectInput, runtimeDesktopOptions } from './desktop.js';
|
|
3
4
|
import { createRenderer, runtimeRendererOptions } from './renderer.js';
|
|
4
5
|
/** Минимальная ширина, при которой перерисовка меню по фиксированному числу строк безопасна. */
|
|
@@ -226,17 +227,24 @@ export async function askLine(input, output, renderer, question, hint, capabilit
|
|
|
226
227
|
restoreListeners(input, listenersBefore);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
export function createReadlinePrompt(input = process.stdin, output = process.stdout) {
|
|
230
|
+
export function createReadlinePrompt(input = process.stdin, output = process.stdout, options = {}) {
|
|
230
231
|
const renderer = createRenderer((text) => output.write(text), runtimeRendererOptions(output));
|
|
231
232
|
const capabilities = promptCapabilities(output, process.env);
|
|
232
233
|
return {
|
|
233
234
|
renderer,
|
|
234
235
|
async ask() {
|
|
236
|
+
// Вход в gh проверяется, пока человек читает приветствие; нет ответа за 3 с — варианта нет.
|
|
237
|
+
const github = (options.detectGithub ?? (() => githubReady()))().catch(() => false);
|
|
235
238
|
renderer.welcome();
|
|
236
|
-
const
|
|
239
|
+
const choices = [
|
|
237
240
|
{ value: 'create', label: 'Создать новый проект' },
|
|
238
241
|
{ value: 'check', label: 'Проверить canonical project' },
|
|
239
|
-
]
|
|
242
|
+
];
|
|
243
|
+
// Новый вариант — последним: «1 — создать» и «2 — проверить» не меняются.
|
|
244
|
+
if (await github)
|
|
245
|
+
choices.push({ value: 'create-github', label: 'Создать новый проект и закрытую копию на GitHub' });
|
|
246
|
+
const chosen = await selectChoice(input, output, renderer, 'Что вы хотите сделать?', choices, capabilities);
|
|
247
|
+
const action = chosen === 'check' ? 'check' : 'create';
|
|
240
248
|
const question = action === 'create' ? 'Как назовём проект? Можно указать полный путь.' : 'Какой canonical project проверить?';
|
|
241
249
|
const hint = action === 'create' ? 'Например: Мой проект. Тогда папка появится на Рабочем столе.' : 'Перетащите папку сюда или вставьте путь.';
|
|
242
250
|
const raw = await askLine(input, output, renderer, question, hint, capabilities);
|
|
@@ -254,7 +262,7 @@ export function createReadlinePrompt(input = process.stdin, output = process.std
|
|
|
254
262
|
], capabilities);
|
|
255
263
|
renderer.preview({ action, target: project.target, name: project.name, usedDesktopDefault: project.usedDesktopDefault });
|
|
256
264
|
renderer.progress('Создаём структуру canonical project…');
|
|
257
|
-
return { action, target: project.target, name: project.name, startingPoint, usedDesktopDefault: project.usedDesktopDefault };
|
|
265
|
+
return { action, target: project.target, name: project.name, startingPoint, usedDesktopDefault: project.usedDesktopDefault, github: chosen === 'create-github' };
|
|
258
266
|
},
|
|
259
267
|
};
|
|
260
268
|
}
|
package/dist/cli/renderer.js
CHANGED
|
@@ -124,12 +124,13 @@ export function createRenderer(write, options) {
|
|
|
124
124
|
model.name ? `Название: ${model.name}` : '',
|
|
125
125
|
'Проект находится здесь:',
|
|
126
126
|
model.target,
|
|
127
|
+
model.cloud ? `Копия в облаке: ${model.cloud}` : 'Копии в облаке нет — завести её поможет /start.',
|
|
127
128
|
'',
|
|
128
129
|
'Что делать дальше:',
|
|
129
|
-
'1. Откройте папку
|
|
130
|
-
'2.
|
|
131
|
-
'3.
|
|
132
|
-
'4.
|
|
130
|
+
'1. Откройте папку проекта в Claude Code.',
|
|
131
|
+
'2. Материалы, если есть, положите в maestro/inbox/. Готовый код оставьте, где лежит: /start спросит путь.',
|
|
132
|
+
'3. Напишите /start — знакомство с задачей.',
|
|
133
|
+
'4. Потом /plan — план до кода.',
|
|
133
134
|
'',
|
|
134
135
|
'Проверка пройдена: структура проекта в порядке.',
|
|
135
136
|
].filter((line, index, all) => line !== '' || (index > 0 && all[index - 1] !== '')), 'success');
|
package/dist/cli/upgrade-run.js
CHANGED
|
@@ -47,6 +47,8 @@ export async function executeUpgradeCommand(options, io) {
|
|
|
47
47
|
if (keptAsIs.length > 0)
|
|
48
48
|
io.out(`Вы меняли эти файлы, поэтому они переданы как есть: ${keptAsIs.join(', ')}. Если в них осталась команда Maestro старой версии, обновите её — актуальная лежит в .claude/rules/maestro.md (doctor напомнит).`);
|
|
49
49
|
list('Сохранено без изменений', analysis.preserves);
|
|
50
|
+
for (const note of analysis.notes)
|
|
51
|
+
io.out(`Важно: ${note}`);
|
|
50
52
|
// До коммита doctor честно покажет git-managed-dirty: сначала diff и коммит, потом проверка.
|
|
51
53
|
io.out('Добавьте в Git все изменения, включая новые файлы (git add -A), просмотрите их (git diff --cached) и закоммитьте: до коммита doctor покажет git-managed-dirty и git-managed-untracked.');
|
|
52
54
|
// Та же версия, что применила обновление: doctor проверяет ровно её канон.
|
|
@@ -60,6 +62,8 @@ export async function executeUpgradeCommand(options, io) {
|
|
|
60
62
|
list('Уже совпадает', analysis.unchanged);
|
|
61
63
|
list('Останется без изменений', analysis.preserves);
|
|
62
64
|
list('Служебные файлы', analysis.metadata);
|
|
65
|
+
for (const note of analysis.notes)
|
|
66
|
+
io.out(`Важно: ${note}`);
|
|
63
67
|
// Применять обязана та же версия, что показала это предложение, а не новая @latest.
|
|
64
68
|
io.out(`Применить: ${serviceInvocation(VERSION)} upgrade --path ${quotePathArg(options.path)} --apply`);
|
|
65
69
|
return EXIT_OK;
|
package/dist/core/doctor/git.js
CHANGED
|
@@ -2,7 +2,7 @@ import { execFile } from 'node:child_process';
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
|
-
import { critical, error, warning } from './types.js';
|
|
5
|
+
import { critical, error, info, warning } from './types.js';
|
|
6
6
|
const execFileAsync = promisify(execFile);
|
|
7
7
|
/** Parse porcelain v1 `-z`; rename/copy records consume two NUL fields. */
|
|
8
8
|
export function parsePorcelainV1Z(output) {
|
|
@@ -43,8 +43,48 @@ export async function checkGit(root, managedDocs, findings, managedFiles = new S
|
|
|
43
43
|
if (managedDocs.has(path))
|
|
44
44
|
findings.push(error('git-managed-dirty', 'Управляемый документ имеет незакоммиченные изменения. Если это результат upgrade — просмотрите diff и закоммитьте; если правка ручная — верните файл.', path));
|
|
45
45
|
}
|
|
46
|
+
await checkCloudCopy(root, findings);
|
|
46
47
|
}
|
|
47
48
|
catch (cause) {
|
|
48
49
|
findings.push(error('git-check-failed', `Не удалось проверить Git: ${cause instanceof Error ? cause.message : String(cause)}`, '.git'));
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
/** Команда git, чей отказ — ответ «нет», а не сбой проверки. */
|
|
53
|
+
async function gitAnswer(root, args) {
|
|
54
|
+
try {
|
|
55
|
+
return (await execFileAsync('git', [...args], { cwd: root, encoding: 'utf8' })).stdout.trim();
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Есть ли копия в облаке — только по локальным данным git, без сети: `git fetch` не
|
|
63
|
+
* запускается, поэтому «отправлено» значит «по данным последней синхронизации».
|
|
64
|
+
* Уровень `info`: не красит ни обычную проверку, ни `--strict`, ни `preflight` —
|
|
65
|
+
* проект может сознательно жить только на компьютере.
|
|
66
|
+
*/
|
|
67
|
+
async function checkCloudCopy(root, findings) {
|
|
68
|
+
const remotes = await gitAnswer(root, ['remote']);
|
|
69
|
+
if (remotes === null)
|
|
70
|
+
return;
|
|
71
|
+
if (remotes === '') {
|
|
72
|
+
findings.push(info('git-no-remote', 'Копии проекта в облаке нет: у репозитория нет remote. Если этот компьютер пропадёт, проект не восстановить. Завести закрытую копию поможет `/start`.'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Ветка без коммитов или detached HEAD: отправлять пока нечего или некуда.
|
|
76
|
+
const branch = await gitAnswer(root, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
|
|
77
|
+
if (branch === null || branch === '' || await gitAnswer(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === null)
|
|
78
|
+
return;
|
|
79
|
+
const upstream = await gitAnswer(root, ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}']);
|
|
80
|
+
if (upstream === null || upstream === '') {
|
|
81
|
+
const names = remotes.split(/\r?\n/).filter(Boolean);
|
|
82
|
+
const remote = names.includes('origin') ? 'origin' : names[0] ?? 'origin';
|
|
83
|
+
findings.push(info('git-no-upstream', `Ветка ${branch} ещё не связана с копией в облаке (upstream), по данным последней синхронизации. Первая отправка: git push -u ${remote} ${branch}.`));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const ahead = Number(await gitAnswer(root, ['rev-list', '--count', '@{u}..HEAD']));
|
|
87
|
+
if (Number.isInteger(ahead) && ahead > 0) {
|
|
88
|
+
findings.push(info('git-unpushed', `Коммитов, не отправленных в облако (${upstream}): ${ahead} — по данным последней синхронизации, без запроса в сеть. Отправка: git push.`));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { readdir } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
1
|
import { pathHasSymlink } from './fs-utils.js';
|
|
5
|
-
import { critical
|
|
2
|
+
import { critical } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* `maestro/inbox/` — одно место для материалов человека: файлы там не замечание,
|
|
5
|
+
* даже в `--strict`. Проверяется только, что путь не уводит за пределы проекта.
|
|
6
|
+
*/
|
|
6
7
|
export async function checkInbox(root, findings) {
|
|
7
8
|
const inboxPath = 'maestro/inbox';
|
|
8
|
-
const dir = join(root, inboxPath);
|
|
9
9
|
if (await pathHasSymlink(root, inboxPath)) {
|
|
10
10
|
findings.push(critical('inbox-symlink', 'Inbox path не должен содержать symbolic link.', inboxPath));
|
|
11
|
-
return;
|
|
12
11
|
}
|
|
13
|
-
if (!existsSync(dir))
|
|
14
|
-
return;
|
|
15
|
-
const entries = (await readdir(dir)).filter((name) => name !== 'README.md' && name !== '.gitkeep');
|
|
16
|
-
if (entries.length > 0)
|
|
17
|
-
findings.push(warning('inbox-not-empty', 'Inbox содержит необработанные материалы.', 'maestro/inbox'));
|
|
18
12
|
}
|
|
@@ -43,7 +43,7 @@ export async function checkSources(root, findings) {
|
|
|
43
43
|
if (!existsSync(metadataAbsolute)) {
|
|
44
44
|
const actualPaths = await sourceFiles(root, join(root, SOURCES_DIR), findings);
|
|
45
45
|
if (actualPaths.length > 0)
|
|
46
|
-
findings.push(critical('source-hashes-missing', '
|
|
46
|
+
findings.push(critical('source-hashes-missing', 'В maestro/sources/ лежат файлы без снимка: эта папка — только для снимков команды `vibe-maestro sources --write`. Свои материалы кладите в maestro/inbox/ — там они не замечание.', metadataPath));
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
try {
|