create-vibe-maestro 0.4.3 → 0.4.5
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 +73 -0
- package/README.md +7 -7
- package/dist/cli/archive-run.js +75 -0
- package/dist/cli/context-run.js +3 -2
- package/dist/cli/maestro.js +22 -3
- package/dist/cli/upgrade-run.js +10 -2
- package/dist/core/archive/audits.js +37 -0
- package/dist/core/archive/disk.js +38 -0
- package/dist/core/archive/index.js +286 -0
- package/dist/core/archive/limits.js +35 -0
- package/dist/core/archive/links.js +65 -0
- package/dist/core/archive/log.js +83 -0
- package/dist/core/archive/markdown.js +28 -0
- package/dist/core/archive/plan.js +220 -0
- package/dist/core/archive/types.js +1 -0
- package/dist/core/audits.js +37 -0
- package/dist/core/context.js +23 -9
- package/dist/core/doctor/fs-utils.js +3 -2
- package/dist/core/doctor/git.js +1 -1
- package/dist/core/doctor/index.js +6 -1
- package/dist/core/doctor/memory-lag.js +79 -0
- package/dist/core/doctor/memory.js +52 -0
- package/dist/core/doctor/plans.js +1 -1
- package/dist/core/doctor/wiki.js +9 -33
- package/dist/core/plan.js +26 -4
- package/dist/core/transaction.js +132 -0
- package/dist/core/upgrade/analyze.js +14 -3
- package/dist/core/upgrade/baseline.js +2 -0
- package/dist/core/upgrade/index.js +15 -112
- package/dist/core/upgrade/releases.js +95 -1
- package/dist/core/wiki-links.js +27 -0
- package/docs/ROADMAP.md +21 -3
- package/docs/USER_GUIDE.md +66 -16
- package/package.json +1 -1
- package/registry/baseline/0.4.3/project/.claude/rules/maestro.md +40 -0
- package/registry/baseline/0.4.3/project/maestro/templates/handoff.md +29 -0
- package/registry/baseline/0.4.3/project/protocols/build.md +120 -0
- package/registry/baseline/0.4.3/project/protocols/completion.md +23 -0
- package/registry/baseline/0.4.3/project/protocols/handoff.md +17 -0
- package/registry/baseline/0.4.3/project/protocols/plan.md +159 -0
- package/registry/baseline/0.4.3/project/protocols/status.md +5 -0
- package/registry/baseline/0.4.3/project/protocols/wiki.md +17 -0
- package/registry/baseline/0.4.3/project/wiki/plans/README.md +135 -0
- package/registry/baseline/0.4.3/project/wiki/plans/TEMPLATE.md +83 -0
- package/registry/baseline/0.4.4/project/.claude/rules/maestro.md +41 -0
- package/registry/baseline/0.4.4/project/maestro/templates/audit.md +31 -0
- package/registry/baseline/0.4.4/project/maestro/templates/handoff.md +29 -0
- package/registry/baseline/0.4.4/project/protocols/audit.md +74 -0
- package/registry/baseline/0.4.4/project/protocols/build.md +120 -0
- package/registry/baseline/0.4.4/project/protocols/completion.md +23 -0
- package/registry/baseline/0.4.4/project/protocols/handoff.md +18 -0
- package/templates/project/.claude/rules/maestro.md +3 -2
- package/templates/project/maestro/templates/audit.md +3 -3
- package/templates/project/maestro/templates/handoff.md +10 -3
- package/templates/project/protocols/audit.md +11 -8
- package/templates/project/protocols/build.md +4 -4
- package/templates/project/protocols/completion.md +4 -4
- package/templates/project/protocols/handoff.md +8 -7
- package/templates/project/protocols/plan.md +3 -2
- package/templates/project/protocols/status.md +1 -1
- package/templates/project/protocols/wiki.md +1 -1
- package/templates/project/wiki/index.md +4 -0
- package/templates/project/wiki/log.md +1 -0
- package/templates/project/wiki/plans/0001-starter.md +2 -2
- package/templates/project/wiki/plans/README.md +21 -1
- package/templates/project/wiki/plans/TEMPLATE.md +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,79 @@ 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.5 — 2026-11-04
|
|
8
|
+
|
|
9
|
+
The sixth part of 0.4: ready for a week of real work. `context` counts in tokens and is checked in the middle of a slice too; `archive` shows what looks open in a section; `doctor` sees memory falling behind the code; check reports carry only what matters and a handoff keeps the numbers; a handoff says honestly what was checked and what got in the way. The set of project files does not change, and the text of the rules does not grow.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`doctor` sees memory falling behind the code**, from git only, as `info`, which never fails `--strict` or `preflight`. Commits outside `wiki/` are counted after the last commit that added a handoff, or after the commit that added `.maestro/manifest.json` while there are no handoffs. `memory-hot-behind`: the plan has a `current_slice`, `wiki/hot.md` does not name it, and there are 3 or more such commits. `memory-handoff-behind`: 10 or more. No `.git`, no anchor, a shallow clone or a git refusal: silent. A handoff that is not committed yet and is newer than the last commit silences both: `doctor` runs before that commit. The numbers are a hypothesis.
|
|
14
|
+
- **`archive` warns about open marks in a section.** UNKNOWN, OPEN_QUESTION, HYPOTHESIS, «не проверено», «открыто»: whole word, any case, in the heading or the text, outside code blocks; a findings line with nothing open does not count. The warning shows up to three lines of 100 characters, then «ещё N», and says what to do: closed — move it; open — first write it to `wiki/hot.md` or `wiki/icebox.md`, because the archive is not copied back. A word alone does not mean open, so nothing is refused.
|
|
15
|
+
- **Handoff sample:** a table `| Пункт | Чем проверено | Результат |`, where what the agent did not check itself is marked «со слов: кого» and never «прошло» without it; the line `Находки: critical N, high N, medium N, low N; открыто N.`; a new section `## Что мешало в работе`, one line or «нет». `protocols/completion.md` uses the same table, and a customer document claims no more than the table says.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **`context` thresholds are in tokens: 400 000 and 600 000.** The size of the session sets the price of a step, not its share of the window. A smaller window keeps the smaller of the two: `min(400 000, 40 % of the window)` and `min(600 000, 70 %)`, so 80 000 and 140 000 at a window of 200 000; `--window` follows the same rule. The numbers are a hypothesis from replaying real sessions.
|
|
20
|
+
- **The session size is checked in the middle of a slice too:** after a commit the agent runs `context`, and «пора в новую сессию» means a handoff now, with the slice left open. Before, `context` ran only after a closed slice, and sessions grew to the end of the window.
|
|
21
|
+
- **Check reports carry only critical, high and open findings.** The reviewer still returns everything, and the fix check gets the findings from the reviewer, not from the report. The author writes the report after the fix check; a handoff in the middle of a round puts everything the fix check has not closed into the report at once, `status: open`. Closed medium and low stay as numbers in the handoff and as fix commits. What is already written is not cleaned up; a report from Cowork is imported whole. The findings of a plan audit go on the same line in the plan's «Утверждение».
|
|
22
|
+
- The line about how many server checks ran now lives only in `protocols/build.md`, for a project with a cloud copy.
|
|
23
|
+
- `upgrade` tells the truth when a rollback fails: the first line no longer promises that nothing changed, and neither does a repeated run that stops on the leftover staging folder.
|
|
24
|
+
- The `vibe-maestro` companion package (0.1.9) depends on exactly `create-vibe-maestro@0.4.5`.
|
|
25
|
+
- Upgrade tests use projects generated by the real published 0.4.4 package.
|
|
26
|
+
|
|
27
|
+
### For those who create projects with their own scripts
|
|
28
|
+
|
|
29
|
+
- **Handoff sample:** «Проверки» now has a table and the line `Находки: critical N, high N, medium N, low N; открыто N.`; there is a new section `## Что мешало в работе`. If you read handoffs by section: the section is new, the order of the old ones is the same.
|
|
30
|
+
- **There will be more handoffs:** they also happen in the middle of a slice. If you take your block from the last handoff, the final handoff must stay the last one and carry the block; if you search by the date a file was added to git, two handoffs must not share a commit.
|
|
31
|
+
- **Check reports:** only critical, high and open findings. No report no longer means no check: look at the findings line of the handoff.
|
|
32
|
+
- **`doctor`:** new `info` codes `memory-hot-behind`, `memory-handoff-behind`; they do not fail `--strict` or `preflight`. They need git.
|
|
33
|
+
- **`context --json`:** `level` now comes from tokens, not from a share of the window; `percent` and `budget` are as before; new fields `finishSliceTokens`, `newSessionTokens`; `reportVersion` stays 1. At a window of 200 000 the levels are the same.
|
|
34
|
+
- **`archive --json`:** `sections[].warnings` also carries lines about open marks; nothing is refused.
|
|
35
|
+
- **`upgrade --json`:** new field `partial`: `true` means a rollback failed and the project is changed in part.
|
|
36
|
+
- **Do not change:** the section names of `wiki/hot.md`; the place and names of handoffs; `create --yes`; the set of Maestro files; `.claude/settings.json` of the template; the parsing of check reports.
|
|
37
|
+
- The `vibe-maestro` companion 0.1.9 is exactly `create-vibe-maestro@0.4.5`. `upgrade` works from 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, 0.4.2, 0.4.3 and 0.4.4.
|
|
38
|
+
- If you pin the version in your own settings, change it and your own equality test.
|
|
39
|
+
- A `.gitignore` with `maestro/inbox/*` also hides the Maestro file `maestro/inbox/.gitattributes`: add an exception.
|
|
40
|
+
|
|
41
|
+
## 0.4.4 — 2026-11-04
|
|
42
|
+
|
|
43
|
+
The fifth part of 0.4: project memory stops growing. A slice result goes to its handoff and the plan keeps one line; old log entries, closed check reports and closed plan edits move to an archive inside the project, and the agent reads the archive by search; `doctor` says when memory gets long. Nothing is deleted: the moved text stays byte for byte, only link addresses change.
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **`vibe-maestro archive`** moves old memory into an archive inside the project in one transaction with a backup and rollback. Without `--apply` it only shows what it would move, with sizes; `--json` reports what moved, what stayed and why. It works only on a project of its own version (otherwise «first `upgrade`»), and refuses on a symbolic link on its paths, on a leftover staging folder of its own or of `upgrade`, and on a destination that git ignores. It never overwrites a file whose name differs only in case or Unicode form: a report stays with the reason, anything else is refused.
|
|
48
|
+
- **Log:** `wiki/log.md` over 20 000 characters — the last entries worth 10 000 characters stay (at least one), older ones go to `wiki/log/YYYY-MM.md` in their order. A pointer line is added to the log header once.
|
|
49
|
+
- **Check reports:** closed ones (`status: resolved`, all findings resolved) go to `wiki/audits/archive/`. Open reports, reports `doctor` cannot read and reports named in a plan's `sources` stay, with the reason.
|
|
50
|
+
- **Plan edits:** `--section "<heading start>"` (repeatable) moves a closed edit of the active plan to `wiki/plans/archive/<plan>.md`; the heading and a line «В архиве: …» stay in the plan. Only sections below «Правки после утверждения» or «Изменения после утверждения» can move; the main part of the plan, the collection itself, «Утверждение» and a section with the current slice in a heading are refused. A wrong name is refused with a list, not a byte written.
|
|
51
|
+
- **Links:** relative links in moved text are rebased, and links in `wiki/**` to a moved report lead to the new place. One link search for `doctor` and `archive`.
|
|
52
|
+
- **Approval digest:** when a plan has one, `archive` works only if the text matches it, then writes the new digest and a line with the date and both digests to the plan's archive. An unapproved edit cannot be laundered this way: a changed plan is refused, and a report it links to stays.
|
|
53
|
+
- **`doctor` reports memory length** as `info`, which never fails `--strict` or `preflight`, because the limits are a hypothesis from three live projects: `memory-hot-long` (6 000 characters), `memory-plan-long` (60 000), `memory-log-long` (20 000), `memory-handoff-long` (6 000, the handoffs with the latest date in the name). Each message gives the number, the guide and what to do.
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- **A slice result lives in the handoff; the plan keeps one line.** Closing a slice: `[ ]` → `[x]` in «Порядок работ» or in the slice's edit, and the tail ` → [итог](../handoffs/<file>.md)` at the end of that line. Only where a `[ ]` exists: slices of older plans have no mark and get none. The result, acceptance and the move to the next slice are not written to the plan. `protocols/handoff.md`, `protocols/build.md`, `wiki/plans/README.md` and `wiki/plans/TEMPLATE.md` say the same.
|
|
58
|
+
- **The tail does not break the approval digest.** Exactly one tail of exactly this form at the end of a checked item is left out of the digest; another link text, another folder, a second tail, a tail on `[ ]` or on a continuation line is plan text. Without tails the digest equals 0.4.3, and plans approved with the 0.4.3 or the earlier digest stay green.
|
|
59
|
+
- **The agent runs `archive` itself** at the handoff of a closed slice and before the final handoff, without asking: it is a move inside the project. The human gets half a line in the summary. The agent names closed plan edits itself.
|
|
60
|
+
- **The archive is read by search.** `.claude/rules/maestro.md`, `protocols/wiki.md`, `protocols/build.md`, `protocols/plan.md` and `protocols/status.md`: find by name or word, read the piece found. To redo a closed part: a new edit mid-plan with a link to the archived one, with the human's «да». The archive is not edited by hand and not copied back. `wiki/attic/` holds outdated and replaced documents; the archive holds closed history.
|
|
61
|
+
- **«Правки после утверждения»** is a section of the plan template: an edit is `### Правка N — суть (дата)`. New plans list slices as `1. [ ]`.
|
|
62
|
+
- `wiki/hot.md`: the guide is now up to 6 000 characters, about 60 lines.
|
|
63
|
+
- `wiki/log.md` and `wiki/index.md` of new projects name the archive as plain paths; existing projects keep theirs, and `upgrade` reminds about the line in `wiki/index.md`.
|
|
64
|
+
- The `vibe-maestro` companion package (0.1.8) depends on exactly `create-vibe-maestro@0.4.4`.
|
|
65
|
+
- Upgrade tests use projects generated by the real published 0.4.3 package.
|
|
66
|
+
|
|
67
|
+
### For those who create projects with their own scripts
|
|
68
|
+
|
|
69
|
+
- **New command `vibe-maestro archive`:** without `--apply` it writes nothing; `--json` gives the report (what moved, what stayed and why; `logNote` says why a long log has nothing to move, `partial: true` means a rollback failed and the project is changed in part); a refusal is exit code 1 with not a byte written. Works only on a project of its own version.
|
|
70
|
+
- **Log:** entries over the limit go to `wiki/log/YYYY-MM.md`; `wiki/log.md` stays the main file, with a line about months in the header. If a script reads the log, it should read `wiki/log/` too.
|
|
71
|
+
- **Check reports:** closed ones (`status: resolved`) go to `wiki/audits/archive/`; open ones stay in `wiki/audits/`; `doctor` checks both folders.
|
|
72
|
+
- **Plan archive** is `wiki/plans/archive/<plan>.md`, not a plan; the heading and a line with a link stay in the plan; `archive` rewrites `approved_digest` only for an unchanged approved plan.
|
|
73
|
+
- **Links:** `archive` fixes link addresses inside `wiki/`; links to moved files from `README.md`, `docs/` and other places outside `wiki/` are not touched. Paths written as plain text stay old: the file is found by name.
|
|
74
|
+
- **Digest:** on a `[x]` item the tail ` → [итог](../handoffs/<file>.md)` is left out; without tails the digest is the same.
|
|
75
|
+
- **`doctor`:** new `info` codes `memory-hot-long`, `memory-plan-long`, `memory-log-long`, `memory-handoff-long`; they do not fail `--strict` or `preflight`.
|
|
76
|
+
- **Do not change:** the section names of `wiki/hot.md`; the place and names of handoffs `wiki/handoffs/YYYY-MM-DD-….md`; `create --yes`; the set of Maestro files; `.claude/settings.json` of the template.
|
|
77
|
+
- **Projects before 0.4.4:** `wiki/index.md` belongs to the project; add the line about the archive if you want it.
|
|
78
|
+
- The `vibe-maestro` companion 0.1.8 is exactly `create-vibe-maestro@0.4.4`. `upgrade` works from 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, 0.4.2 and 0.4.3.
|
|
79
|
+
|
|
7
80
|
## 0.4.3 — 2026-11-01
|
|
8
81
|
|
|
9
82
|
The fourth part of 0.4: checks, protocols and command fixes. Checks run once and only the fixes are re-checked; small tasks follow the same path as any plan; eight protocols instead of eighteen; `upgrade` shows its changes and can remove retired Maestro files; `pack` shows what goes to the customer before packing. The set of project files changes; `vibe-maestro upgrade` migrates projects from 0.4.2, 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.
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT]
|
|
28
|
-
> **0.4.
|
|
28
|
+
> **0.4.5 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
|
|
|
@@ -78,7 +78,7 @@ Vibe Coding Maestro doctor: всё сходится.
|
|
|
78
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.
|
|
79
79
|
|
|
80
80
|
> [!WARNING]
|
|
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, 0.4.2). 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, 0.4.2, 0.4.3, 0.4.4). 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.
|
|
82
82
|
|
|
83
83
|
## Что дальше после создания проекта: Planning Gate
|
|
84
84
|
|
|
@@ -178,7 +178,7 @@ From there, `protocols/build.md` routes the agent through the relevant rules, pl
|
|
|
178
178
|
|
|
179
179
|
## A normal working cycle
|
|
180
180
|
|
|
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. Checks run once: the plan is always checked against the real situation, a plan audit before approval, one code review per slice, then only the fixes are re-checked; the agent runs tests and checks itself and asks the human only about what they understand and own. Independent audit findings are recorded with stable IDs on one `critical | high | medium | low` scale (sample: `maestro/templates/audit.md`); 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, at the end of a slice and after a commit in the middle of one). 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. Checks run once: the plan is always checked against the real situation, a plan audit before approval, one code review per slice, then only the fixes are re-checked; the agent runs tests and checks itself and asks the human only about what they understand and own. Independent audit findings are recorded with stable IDs on one `critical | high | medium | low` scale (sample: `maestro/templates/audit.md`); a report holds only `critical`, `high` and open findings, and the handoff keeps the numbers of all of them; open `high` or `critical` findings block a green doctor result. A handoff marks what the agent did not check itself, and `doctor` says when memory falls behind the code.
|
|
182
182
|
|
|
183
183
|
Claude Code projects receive six thin commands:
|
|
184
184
|
|
|
@@ -207,7 +207,7 @@ Maestro is deliberately conservative around existing data and Git state:
|
|
|
207
207
|
- API keys live only in `.env`, which `.gitignore` excludes and `doctor` reports if Git tracks it; the agent writes a key you paste into `.env` itself, or opens `.env` in an editor for you to paste it (a key typed into the chat stays in the session history);
|
|
208
208
|
- `sources` reads existing code read-only and writes nothing without an explicit `--write`;
|
|
209
209
|
- `pack` builds the customer archive only from a delivery tag, leaves Maestro and agent folders out, adds `HANDOVER.md` with «change all passwords and keys» (or «there were no accesses» when every access section of the passport is «не применимо»), refuses on common kinds of secrets (a sieve, not a guarantee) or an incomplete passport, and gives the same bytes for the same tag; `pack --dry-run` shows the archive list first and highlights service files, personal paths, Maestro names, internal folders and plan numbers;
|
|
210
|
-
- `upgrade` is a dry run without `--apply` (`--diff` prints the changes themselves), refuses a modified managed file, removes only untouched Maestro files that left the canon, and rolls back a failed apply;
|
|
210
|
+
- `upgrade` is a dry run without `--apply` (`--diff` prints the changes themselves), refuses a modified managed file, removes only untouched Maestro files that left the canon, and rolls back a failed apply; `archive` moves old memory inside the project the same way — nothing deleted, text byte for byte except link addresses, a plan's approval digest rewritten only when the text matched it;
|
|
211
211
|
- generated projects pin the exact Maestro version instead of `@latest`, so a new release cannot change a project's checks until someone runs `upgrade`;
|
|
212
212
|
- there is intentionally no `doctor --fix` that could overwrite useful work.
|
|
213
213
|
|
|
@@ -289,12 +289,12 @@ npx --package create-vibe-maestro@latest vibe-maestro doctor --path . --strict
|
|
|
289
289
|
npx --package create-vibe-maestro@latest vibe-maestro skills --path .
|
|
290
290
|
npx --package create-vibe-maestro@latest vibe-maestro preflight --path . --json
|
|
291
291
|
npx --package create-vibe-maestro@latest vibe-maestro sources --path . --source "../durak" --source "../dice-poker"
|
|
292
|
-
npx --package create-vibe-maestro@latest vibe-maestro
|
|
292
|
+
npx --package create-vibe-maestro@latest vibe-maestro archive --path .
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
`preflight` and `doctor` exit `0` when the check passes and `1` when it blocks; `sources` and `
|
|
295
|
+
`preflight` and `doctor` exit `0` when the check passes and `1` when it blocks; `sources`, `upgrade` and `archive` write nothing at all unless you add `--write` or `--apply`.
|
|
296
296
|
|
|
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, 0.4.1 and 0.4.
|
|
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, 0.4.1, 0.4.2, 0.4.3 and 0.4.4. Pull requests and `main` run on Ubuntu, macOS, and Windows with Node.js 20 and 22; a branch push runs one quick Ubuntu job.
|
|
298
298
|
|
|
299
299
|
## Current scope
|
|
300
300
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AUDITS_ARCHIVE_DIR } from '../core/archive/audits.js';
|
|
2
|
+
import { formatChars } from '../core/archive/limits.js';
|
|
3
|
+
import { archiveProject } from '../core/archive/index.js';
|
|
4
|
+
import { plainTitle } from '../core/archive/plan.js';
|
|
5
|
+
import { quotePathArg, serviceInvocation, VERSION } from '../core/meta.js';
|
|
6
|
+
import { EXIT_FAILED, EXIT_OK } from './io.js';
|
|
7
|
+
const DIGEST_SHOWN = 12;
|
|
8
|
+
function describe(report, io) {
|
|
9
|
+
const { log, audits } = report;
|
|
10
|
+
if (log !== null) {
|
|
11
|
+
const months = log.months.map((month) => `${month.path} (${month.entries})`).join(', ');
|
|
12
|
+
io.out(`- Журнал wiki/log.md: ${formatChars(log.chars)} знаков при пороге ${formatChars(log.limit)} — записей в архив: ${log.movedEntries} → ${months}; в wiki/log.md остаются последние ${log.keptEntries} (до ${formatChars(log.keep)} знаков).`);
|
|
13
|
+
}
|
|
14
|
+
if (audits.moved.length > 0)
|
|
15
|
+
io.out(`- Закрытые отчёты проверок: ${audits.moved.length} → ${AUDITS_ARCHIVE_DIR}/.`);
|
|
16
|
+
for (const section of report.sections) {
|
|
17
|
+
if (section.status === 'already') {
|
|
18
|
+
io.out(`- Раздел «${section.heading}» уже в архиве.`);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
io.out(`- Раздел плана «${section.heading}»: ${formatChars(section.chars)} знаков → ${report.planArchive}; в плане остаются заголовок и строка со ссылкой.`);
|
|
22
|
+
for (const nested of section.nested)
|
|
23
|
+
io.out(` - внутри «${nested.heading}»: ${formatChars(nested.chars)} знаков.`);
|
|
24
|
+
for (const warning of section.warnings)
|
|
25
|
+
io.out(` - Проверьте: ${warning}`);
|
|
26
|
+
}
|
|
27
|
+
if (report.logNote !== null)
|
|
28
|
+
io.out(`- ${report.logNote}`);
|
|
29
|
+
for (const digest of report.digests)
|
|
30
|
+
io.out(`- Отпечаток ${digest.plan}: ${digest.before.slice(0, DIGEST_SHOWN)}… → ${digest.after.slice(0, DIGEST_SHOWN)}…; оба записаны в архиве плана.`);
|
|
31
|
+
if (report.relinked.length > 0)
|
|
32
|
+
io.out(`- Адреса ссылок поправлены в файлах: ${report.relinked.length}.`);
|
|
33
|
+
for (const item of audits.kept)
|
|
34
|
+
io.out(`- Остаётся ${item.path}: ${item.reason}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Без `--apply` команда только показывает, что перенесёт: ни байта не пишет.
|
|
38
|
+
* Перенос — внутри проекта, ничего не удаляется.
|
|
39
|
+
*/
|
|
40
|
+
export async function executeArchiveCommand(options, io) {
|
|
41
|
+
const report = await archiveProject(options.path, {
|
|
42
|
+
apply: options.apply === true,
|
|
43
|
+
...(options.sections === undefined ? {} : { sections: options.sections }),
|
|
44
|
+
...(options.hooks === undefined ? {} : { hooks: options.hooks }),
|
|
45
|
+
});
|
|
46
|
+
if (options.json) {
|
|
47
|
+
io.out(JSON.stringify(report, null, 2));
|
|
48
|
+
return report.ok ? EXIT_OK : EXIT_FAILED;
|
|
49
|
+
}
|
|
50
|
+
if (!report.ok) {
|
|
51
|
+
io.err(report.partial ? 'Vibe Coding Maestro archive: перенос прерван, и откатить удалось не всё: проект изменён частично.' : 'Vibe Coding Maestro archive: перенос не выполнен (изменений на диске нет).');
|
|
52
|
+
if (report.error !== undefined)
|
|
53
|
+
io.err(`- ${report.error}`);
|
|
54
|
+
for (const item of report.blockers)
|
|
55
|
+
io.err(`- ${item.code}${item.path ? ` (${item.path})` : ''}: ${item.message}`);
|
|
56
|
+
return EXIT_FAILED;
|
|
57
|
+
}
|
|
58
|
+
if (report.writes.length === 0) {
|
|
59
|
+
const reasons = [report.logNote === null ? 'журнал не больше порога' : null, report.audits.kept.length === 0 ? 'закрытых отчётов нет' : null].filter((reason) => reason !== null);
|
|
60
|
+
io.out(`Переносить в архив нечего${reasons.length > 0 ? `: ${reasons.join(', ')}` : ''}.`);
|
|
61
|
+
describe(report, io);
|
|
62
|
+
return EXIT_OK;
|
|
63
|
+
}
|
|
64
|
+
if (report.applied) {
|
|
65
|
+
io.out('Vibe Coding Maestro archive: перенесено в архив.');
|
|
66
|
+
describe(report, io);
|
|
67
|
+
io.out('Ничего не удалено: перенесённый текст — в файлах архива. Проект в git — закоммитьте изменения.');
|
|
68
|
+
return EXIT_OK;
|
|
69
|
+
}
|
|
70
|
+
io.out('Vibe Coding Maestro archive: будет перенесено в архив (пробный запуск, ни байта не записано).');
|
|
71
|
+
describe(report, io);
|
|
72
|
+
const named = (options.sections ?? []).map((section) => ` --section "${plainTitle(section)}"`).join('');
|
|
73
|
+
io.out(`Перенести: ${serviceInvocation(VERSION)} archive --path ${quotePathArg(options.path)}${named} --apply`);
|
|
74
|
+
return EXIT_OK;
|
|
75
|
+
}
|
package/dist/cli/context-run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { measureContext, thresholdsFor } from '../core/context.js';
|
|
2
2
|
import { EXIT_FAILED, EXIT_OK } from './io.js';
|
|
3
3
|
/** Тысячи через пробел, без зависимости от локали машины. */
|
|
4
4
|
export function formatTokens(value) {
|
|
@@ -43,6 +43,7 @@ export async function executeContextCommand(options, io) {
|
|
|
43
43
|
io.out(ADVICE[report.level]);
|
|
44
44
|
const total = report.totalInputTokens ?? 0;
|
|
45
45
|
io.out(`За сессию модель получила на вход ${formatTokens(total)} ${tokensWord(total)} (шагов модели: ${report.requests}): каждый шаг заново пересылает всю историю.`);
|
|
46
|
-
|
|
46
|
+
const { finishSliceTokens, newSessionTokens } = thresholdsFor(report.budget);
|
|
47
|
+
io.out(`Пороги ${formatTokens(finishSliceTokens)} и ${formatTokens(newSessionTokens)} ${tokensWord(newSessionTokens)} — гипотеза; их уточнит замер.`);
|
|
47
48
|
return EXIT_OK;
|
|
48
49
|
}
|
package/dist/cli/maestro.js
CHANGED
|
@@ -15,6 +15,7 @@ const HELP = `${PRODUCT_NAME} — служебный CLI проекта.
|
|
|
15
15
|
preflight механическая проверка права начинать код по активному плану
|
|
16
16
|
pack архив тега сдачи для заказчика: без папок Maestro, с HANDOVER.md
|
|
17
17
|
context размер текущей сессии Claude Code: пора ли в новую сессию
|
|
18
|
+
archive перенос старой памяти проекта в архив внутри проекта (ничего не удаляет)
|
|
18
19
|
|
|
19
20
|
Общие опции команд:
|
|
20
21
|
--path <путь> корень проверяемого проекта (по умолчанию текущая папка)
|
|
@@ -39,6 +40,10 @@ const HELP = `${PRODUCT_NAME} — служебный CLI проекта.
|
|
|
39
40
|
--allow <путь> файл, который человек проверил: не секрет; флаг можно повторять
|
|
40
41
|
--dry-run состав архива с подсветкой внутреннего; ничего не пишет
|
|
41
42
|
|
|
43
|
+
Опции archive:
|
|
44
|
+
--apply перенести; без флага только показывает, что перенесёт
|
|
45
|
+
--section <начало> закрытая правка активного плана по началу заголовка; флаг можно повторять
|
|
46
|
+
|
|
42
47
|
Опции context:
|
|
43
48
|
--window <токены> окно модели в токенах (по умолчанию — по модели из журнала сессии)
|
|
44
49
|
|
|
@@ -49,7 +54,7 @@ const HELP = `${PRODUCT_NAME} — служебный CLI проекта.
|
|
|
49
54
|
Общие опции:
|
|
50
55
|
--help, -h эта справка
|
|
51
56
|
--version, -v версия`;
|
|
52
|
-
const COMMANDS = ['doctor', 'skills', 'sources', 'upgrade', 'preflight', 'pack', 'context'];
|
|
57
|
+
const COMMANDS = ['doctor', 'skills', 'sources', 'upgrade', 'preflight', 'pack', 'context', 'archive'];
|
|
53
58
|
const isCommand = (value) => COMMANDS.includes(value);
|
|
54
59
|
export function parseMaestroArgs(argv) {
|
|
55
60
|
if (argv.length === 0)
|
|
@@ -83,10 +88,20 @@ export function parseMaestroArgs(argv) {
|
|
|
83
88
|
break;
|
|
84
89
|
}
|
|
85
90
|
case '--apply': {
|
|
86
|
-
|
|
91
|
+
if (first !== 'upgrade' && first !== 'archive')
|
|
92
|
+
return { kind: 'error', message: `Флаг ${arg} доступен только для upgrade и archive.` };
|
|
93
|
+
options.apply = true;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case '--section': {
|
|
97
|
+
const message = only(arg, 'archive');
|
|
87
98
|
if (message !== null)
|
|
88
99
|
return { kind: 'error', message };
|
|
89
|
-
|
|
100
|
+
const section = value();
|
|
101
|
+
if (section === undefined || section.trim() === '')
|
|
102
|
+
return { kind: 'error', message: `Флаг ${arg} требует значение: начало заголовка раздела.` };
|
|
103
|
+
options.sections = [...(options.sections ?? []), section];
|
|
104
|
+
i += 1;
|
|
90
105
|
break;
|
|
91
106
|
}
|
|
92
107
|
case '--diff': {
|
|
@@ -278,6 +293,10 @@ export async function runMaestroCli(argv, io = processIo) {
|
|
|
278
293
|
const { executePackCommand } = await import('./pack-run.js');
|
|
279
294
|
return executePackCommand({ ...parsed.options, tag: parsed.options.tag }, io);
|
|
280
295
|
}
|
|
296
|
+
if (parsed.kind === 'archive') {
|
|
297
|
+
const { executeArchiveCommand } = await import('./archive-run.js');
|
|
298
|
+
return executeArchiveCommand(parsed.options, io);
|
|
299
|
+
}
|
|
281
300
|
if (parsed.kind === 'context') {
|
|
282
301
|
const { executeContextCommand } = await import('./context-run.js');
|
|
283
302
|
return executeContextCommand(parsed.options, io);
|
package/dist/cli/upgrade-run.js
CHANGED
|
@@ -19,13 +19,17 @@ const DIFF_TITLES = {
|
|
|
19
19
|
* а запись требует отдельного человеческого намерения.
|
|
20
20
|
*/
|
|
21
21
|
export async function executeUpgradeCommand(options, io) {
|
|
22
|
-
const result = await upgradeProject(options.path, {
|
|
22
|
+
const result = await upgradeProject(options.path, {
|
|
23
|
+
apply: options.apply === true,
|
|
24
|
+
...(options.hooks === undefined ? {} : { hooks: options.hooks }),
|
|
25
|
+
});
|
|
23
26
|
if (options.json) {
|
|
24
27
|
io.out(JSON.stringify({
|
|
25
28
|
reportVersion: 1,
|
|
26
29
|
ok: result.ok,
|
|
27
30
|
applied: result.applied,
|
|
28
31
|
rolledBack: result.rolledBack,
|
|
32
|
+
partial: result.partial,
|
|
29
33
|
...(result.error === undefined ? {} : { error: result.error }),
|
|
30
34
|
analysis: result.analysis,
|
|
31
35
|
}, null, 2));
|
|
@@ -33,7 +37,11 @@ export async function executeUpgradeCommand(options, io) {
|
|
|
33
37
|
}
|
|
34
38
|
const { analysis } = result;
|
|
35
39
|
if (analysis.status === 'blocked' || result.ok === false) {
|
|
36
|
-
|
|
40
|
+
// Осталась папка транзакции: прошлый запуск мог изменить проект, поэтому «изменений нет» здесь не обещается.
|
|
41
|
+
const staged = analysis.blockers.some((item) => item.code === 'upgrade-staging-present');
|
|
42
|
+
io.err(result.partial
|
|
43
|
+
? 'Vibe Coding Maestro upgrade: обновление прервано, и откатить удалось не всё: проект изменён частично.'
|
|
44
|
+
: `Vibe Coding Maestro upgrade: ${staged ? 'обновление не запущено.' : 'обновление не выполнено (изменений на диске нет).'}`);
|
|
37
45
|
if (result.error !== undefined)
|
|
38
46
|
io.err(`- ${result.error}`);
|
|
39
47
|
for (const item of analysis.blockers)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { parseAudit } from '../audits.js';
|
|
2
|
+
import { parseFlowList } from '../plan.js';
|
|
3
|
+
import { linkTargets } from './links.js';
|
|
4
|
+
import { withoutBom } from './markdown.js';
|
|
5
|
+
export const AUDITS_ARCHIVE_DIR = 'wiki/audits/archive';
|
|
6
|
+
export const AUDIT_FILE_RE = /^wiki\/audits\/([^/]+\.md)$/;
|
|
7
|
+
/**
|
|
8
|
+
* В архив уходят только закрытые отчёты. Открытые остаются: их видят `/status`,
|
|
9
|
+
* завершение и скрипты, и закрыть их можно позже.
|
|
10
|
+
*/
|
|
11
|
+
export function selectAudits(files, plans, disk) {
|
|
12
|
+
const moved = new Map();
|
|
13
|
+
const kept = [];
|
|
14
|
+
const sources = new Set(plans.flatMap((plan) => parseFlowList(plan.meta?.sources ?? '[]') ?? []).map((source) => disk.locate('', source) ?? source));
|
|
15
|
+
const changed = plans.filter((plan) => plan.guarded && !plan.intact).map((plan) => ({ path: plan.path, links: linkTargets(plan.text, plan.path, disk.locate) }));
|
|
16
|
+
for (const [path, text] of [...files].sort(([left], [right]) => left.localeCompare(right))) {
|
|
17
|
+
const name = AUDIT_FILE_RE.exec(path)?.[1];
|
|
18
|
+
if (name === undefined)
|
|
19
|
+
continue;
|
|
20
|
+
const target = `${AUDITS_ARCHIVE_DIR}/${name}`;
|
|
21
|
+
const audit = parseAudit(withoutBom(text));
|
|
22
|
+
const blockingPlan = changed.find((plan) => plan.links.has(path));
|
|
23
|
+
if (audit.malformed)
|
|
24
|
+
kept.push({ path, code: 'audit-malformed', reason: 'doctor не разобрал отчёт (audit-malformed): сначала поправьте его.' });
|
|
25
|
+
else if (!audit.closed)
|
|
26
|
+
kept.push({ path, code: 'audit-open', reason: 'отчёт открыт: в архив уходят только status: resolved.' });
|
|
27
|
+
else if (sources.has(path))
|
|
28
|
+
kept.push({ path, code: 'audit-plan-source', reason: 'отчёт назван в sources плана.' });
|
|
29
|
+
else if (disk.exists(target))
|
|
30
|
+
kept.push({ path, code: 'audit-archive-exists', reason: `в архиве уже есть ${target}: перезаписывать нельзя.` });
|
|
31
|
+
else if (blockingPlan !== undefined)
|
|
32
|
+
kept.push({ path, code: 'audit-plan-changed', reason: `на него ссылается ${blockingPlan.path}, а текст этого плана изменился после утверждения: ссылку править нельзя.` });
|
|
33
|
+
else
|
|
34
|
+
moved.set(path, target);
|
|
35
|
+
}
|
|
36
|
+
return { moved, kept };
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { existsSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
function identity(absolute) {
|
|
4
|
+
try {
|
|
5
|
+
const stats = statSync(absolute, { bigint: true });
|
|
6
|
+
return `${stats.dev}:${stats.ino}`;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** Номер файла верен не на любом диске, поэтому тот же файл — это ещё и то же имя с точностью до регистра и формы букв. */
|
|
13
|
+
const sameName = (left, right) => basename(left).normalize('NFC').toLowerCase() === basename(right).normalize('NFC').toLowerCase();
|
|
14
|
+
/** `tracked` — файлы, которые адрес должен находить под их настоящим именем, как бы он ни был записан. */
|
|
15
|
+
export function projectDisk(root, tracked) {
|
|
16
|
+
const known = new Map();
|
|
17
|
+
for (const path of tracked) {
|
|
18
|
+
const id = identity(join(root, path));
|
|
19
|
+
if (id !== null)
|
|
20
|
+
known.set(id, path);
|
|
21
|
+
}
|
|
22
|
+
const located = new Map();
|
|
23
|
+
return {
|
|
24
|
+
exists: (path) => existsSync(join(root, path)),
|
|
25
|
+
locate: (from, decoded) => {
|
|
26
|
+
const absolute = resolve(root, dirname(from), decoded);
|
|
27
|
+
if (located.has(absolute))
|
|
28
|
+
return located.get(absolute);
|
|
29
|
+
const id = identity(absolute);
|
|
30
|
+
const inside = relative(root, absolute);
|
|
31
|
+
const outside = inside === '' || inside === '..' || inside.startsWith(`..${sep}`) || isAbsolute(inside);
|
|
32
|
+
const same = id === null ? undefined : known.get(id);
|
|
33
|
+
const path = (same !== undefined && sameName(same, absolute) ? same : undefined) ?? (outside ? undefined : inside.split(sep).join('/'));
|
|
34
|
+
located.set(absolute, path);
|
|
35
|
+
return path;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|