agent-quality-kit 0.2.4 → 0.3.0
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/README.md +118 -94
- package/README.ru.md +178 -0
- package/kit/gates/_skip.sh +31 -3
- package/kit/gates/commit-explains-itself/gate.yml +1 -0
- package/kit/gates/complexity-limit/gate.yml +1 -0
- package/kit/gates/dead-code/gate.yml +1 -0
- package/kit/gates/deps-are-pinned/gate.yml +1 -0
- package/kit/gates/duplicate-code/gate.yml +1 -0
- package/kit/gates/entry-links-exist/gate.yml +1 -0
- package/kit/gates/file-size-limit/gate.yml +1 -0
- package/kit/gates/gate-has-samples/gate.yml +1 -0
- package/kit/gates/gates-are-runnable/gate.yml +1 -0
- package/kit/gates/gates-run-in-ci/gate.yml +1 -0
- package/kit/gates/lesson-has-outcome/gate.yml +1 -0
- package/kit/gates/no-print-in-prod/check.sh +3 -1
- package/kit/gates/no-print-in-prod/gate.yml +1 -0
- package/kit/gates/secrets-not-in-code/gate.yml +1 -0
- package/kit/gates/swallowed-error/gate.yml +1 -0
- package/kit/gates/todo-without-task/gate.yml +1 -0
- package/package.json +2 -1
- package/tool/commands/doctor.mjs +38 -41
- package/tool/commands/gates.mjs +103 -109
- package/tool/commands/project.mjs +84 -85
- package/tool/commands/report.mjs +194 -0
- package/tool/i18n/en.mjs +423 -0
- package/tool/i18n/index.mjs +33 -0
- package/tool/i18n/ru.mjs +424 -0
- package/tool/i18n/templates-en.mjs +164 -0
- package/tool/i18n/templates-ru.mjs +170 -0
- package/tool/lib/core.mjs +5 -1
- package/tool/lib/manifest.mjs +12 -31
- package/tool/lib/repo.mjs +45 -21
- package/tool/lib/templates.mjs +38 -182
- package/tool/program.mjs +31 -9
- package/tool/selfcheck/gates.sh +7 -1
- package/tool/selfcheck/smoke.sh +97 -0
- package/tool/selfcheck/units.mjs +80 -5
package/README.md
CHANGED
|
@@ -1,160 +1,184 @@
|
|
|
1
1
|
# AQK — Agent Quality Kit
|
|
2
2
|
|
|
3
|
+
**English** · [Русский](README.ru.md)
|
|
4
|
+
|
|
3
5
|
[](https://www.npmjs.com/package/agent-quality-kit)
|
|
4
|
-
[](https://github.com/arsen-ask-lx/Agent_Quality_Kit/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
**A standard for whether a repository is ready to have its code written by agents.** Every
|
|
10
|
+
promise the project makes turns into a command with an exit code — held by a machine, not by
|
|
11
|
+
someone's good intentions.
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
What a project needs before that is even possible, in plain words, independent of language and
|
|
14
|
+
tooling: [the dark factory and the minimum that isn't optional](kit/docs/ai/project-baseline.md).
|
|
12
15
|
|
|
13
16
|
```bash
|
|
14
|
-
npx agent-quality-kit start #
|
|
15
|
-
npx agent-quality-kit doctor #
|
|
17
|
+
npx agent-quality-kit start # no code yet: day-zero guards, right away
|
|
18
|
+
npx agent-quality-kit doctor # code already exists: your level and what to install
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
`npx github:arsen-ask-lx/Agent_Quality_Kit doctor`,
|
|
20
|
-
|
|
21
|
+
Nothing to install — `npx` fetches the package itself (230 KB). The bleeding edge straight from
|
|
22
|
+
the repository is `npx github:arsen-ask-lx/Agent_Quality_Kit doctor`, but the first run that way
|
|
23
|
+
stays silent for two or three minutes: it clones the whole repository.
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
**Requirements.** Node 18+ and an `sh` shell — present on macOS, Linux and WSL; Git Bash works on
|
|
26
|
+
Windows. The portable checks are written in `sh` on purpose: it exists everywhere code is built.
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
**Tool-agnostic:** Claude Code, Codex, Cursor — and without AI at all.
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
The first time you run `init`/`start` on a machine, it prints a link to star the repo and to open
|
|
31
|
+
an issue, once. Nothing is posted anywhere — it is text for a human, and it never repeats.
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
**Off-the-shelf rules are optional and installed separately.** The portable check always works
|
|
34
|
+
without them; if the project already has `ruff`, `eslint` or `vulture`, the entry will use the
|
|
35
|
+
native rule instead — it is more precise. One entry, `dead-code`, does not work at all without a
|
|
36
|
+
real tool and honestly hides itself: you cannot build a call graph with a text search.
|
|
34
37
|
|
|
35
|
-
##
|
|
38
|
+
## How it works
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
The whole standard is one `.aqk.yml` file in the repository root:
|
|
38
41
|
|
|
39
42
|
```yaml
|
|
40
43
|
aqk: 1
|
|
41
|
-
entry: [AGENTS.md] #
|
|
42
|
-
rules: .aqk/rules #
|
|
43
|
-
gates: #
|
|
44
|
+
entry: [AGENTS.md] # what the agent reads first
|
|
45
|
+
rules: .aqk/rules # where the standards live
|
|
46
|
+
gates: # what must pass — as commands, not as prose
|
|
44
47
|
lint: "npm run lint"
|
|
45
48
|
secrets-not-in-code: "bash gates/secrets-not-in-code/check.sh ."
|
|
46
|
-
samples: gates #
|
|
47
|
-
ratchets: ratchets #
|
|
48
|
-
lessons: incidents #
|
|
49
|
+
samples: gates # a red and a green sample for every entry
|
|
50
|
+
ratchets: ratchets # debt registries: the list may only get shorter
|
|
51
|
+
lessons: incidents # where lessons accumulate
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
An empty field is not a placeholder — it is an honest "this level is not reached". `init` writes
|
|
55
|
+
them empty, and they fill in as there becomes something real to put in them.
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
**If a claim cannot be checked by a machine, it is not in this standard.** Otherwise the badge
|
|
58
|
+
would mean trust in the author rather than a fact.
|
|
56
59
|
|
|
57
|
-
##
|
|
60
|
+
## Four levels
|
|
58
61
|
|
|
59
|
-
|
|
|
62
|
+
| Level | Required | What it proves |
|
|
60
63
|
|---|---|---|
|
|
61
|
-
| **AQK-0** |
|
|
62
|
-
| **AQK-1** |
|
|
63
|
-
| **AQK-2** |
|
|
64
|
-
| **AQK-3** |
|
|
64
|
+
| **AQK-0** | a manifest and an entry point | the tooling knows what to read |
|
|
65
|
+
| **AQK-1** | rules exist, gates declared as commands | the checks are executable |
|
|
66
|
+
| **AQK-2** | gates have red and green samples, debt under a ratchet | the gate catches defects and stays quiet on correct code |
|
|
67
|
+
| **AQK-3** | a lesson journal with conclusions | the same bruise is not collected twice |
|
|
65
68
|
|
|
66
69
|
```bash
|
|
67
|
-
aqk doctor --run --min 1 #
|
|
70
|
+
aqk doctor --run --min 1 # in CI: fails below AQK-1 OR if any gate failed
|
|
68
71
|
```
|
|
69
72
|
|
|
70
|
-
##
|
|
73
|
+
## Installing a gate
|
|
71
74
|
|
|
72
75
|
```bash
|
|
73
|
-
aqk find "
|
|
74
|
-
aqk doctor
|
|
75
|
-
aqk add secrets-not-in-code
|
|
76
|
-
aqk doctor --run
|
|
77
|
-
aqk ratchet no-print-in-prod
|
|
76
|
+
aqk find "print statements in production" # is there already such a gate — matched by intent
|
|
77
|
+
aqk doctor # what applies to this repository and what is missing
|
|
78
|
+
aqk add secrets-not-in-code # copies the check and its samples in, declares it
|
|
79
|
+
aqk doctor --run # runs the declared gates and shows the result
|
|
80
|
+
aqk ratchet no-print-in-prod # existing violations become debt, new ones are blocked
|
|
78
81
|
```
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
Every `doctor --run` rewrites `.aqk/last-run.md` — a short report of what actually ran and how
|
|
84
|
+
long it took. The list of gates in the manifest says nothing about how many of them are alive
|
|
85
|
+
right now; the report does. The file is ephemeral — keep it in your own `.gitignore`.
|
|
83
86
|
|
|
84
|
-
##
|
|
87
|
+
## When a bug slips past the guards
|
|
85
88
|
|
|
86
89
|
```bash
|
|
87
|
-
aqk why "
|
|
90
|
+
aqk why "a file grew to nine thousand lines"
|
|
88
91
|
```
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
The answer is one of three, and it is chosen by an actual run rather than by memory: **there was
|
|
94
|
+
no guard** · **the guard exists but does not see this failure** · **the guard exists and catches
|
|
95
|
+
it — so it was bypassed**. The difference decides what to fix: the check itself, or its place in
|
|
96
|
+
the pipeline. Without a run those two are indistinguishable, and people usually fix the wrong
|
|
97
|
+
one. On an uncertain match the command asks instead of choosing for you.
|
|
98
|
+
|
|
99
|
+
**The ratchet** is for introducing a rule into a project whose existing code violates it. The
|
|
100
|
+
violations are captured into a registry; the gate lets that list get **shorter** and refuses to
|
|
101
|
+
let it grow. The rule applies from the day it is installed — the old code stays untouched.
|
|
102
|
+
|
|
103
|
+
`add` **copies the check into your repository** rather than referencing the package: installed
|
|
104
|
+
via `npx` the package is temporary, and tomorrow the command in your manifest would point at
|
|
105
|
+
nothing.
|
|
106
|
+
|
|
107
|
+
## Third-party code inside the repository
|
|
94
108
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
A reference copy, vendored code, generated clients — code that lives here but was not written
|
|
110
|
+
here. The scanning checks will skip it if you add `.aqkignore` in the root: one pattern per line,
|
|
111
|
+
`#` starts a comment, and `*` does not cross `/`.
|
|
98
112
|
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
```
|
|
114
|
+
# brought in from another repository
|
|
115
|
+
third-party/
|
|
116
|
+
vendor/
|
|
117
|
+
*.generated.js
|
|
118
|
+
```
|
|
101
119
|
|
|
102
|
-
|
|
120
|
+
`aqk report` prints the contents of this file as its own section. Hiding things silently is the
|
|
121
|
+
same class as a silent gate: a line here means there is no protection along that path, and will
|
|
122
|
+
not be.
|
|
103
123
|
|
|
104
|
-
|
|
105
|
-
что уже держит машина, что применимо и не поставлено, что скрыто и почему. Каталог может
|
|
106
|
-
вырасти до сотен записей, конкретный проект по-прежнему увидит десяток.
|
|
124
|
+
## The catalogue of promises
|
|
107
125
|
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
`doctor` inspects the repository — languages, existing gates — and shows **only what applies**:
|
|
127
|
+
what a machine already holds, what applies but is not installed, and what is hidden and why. The
|
|
128
|
+
catalogue may grow to hundreds of entries; a given project still sees about a dozen.
|
|
110
129
|
|
|
111
|
-
|
|
130
|
+
An entry is accepted only if its arbiter goes red on the red sample, stays quiet on the green
|
|
131
|
+
one, and names a real failure it caught. A machine checks this: `bash tool/selfcheck/gates.sh`.
|
|
132
|
+
|
|
133
|
+
## The guides as a single file
|
|
112
134
|
|
|
113
135
|
```bash
|
|
114
|
-
aqk blob #
|
|
136
|
+
aqk blob # assembles GOD_AI.md out of kit/docs — to hand the guides to a chat in one go
|
|
115
137
|
```
|
|
116
138
|
|
|
117
|
-
|
|
118
|
-
|
|
139
|
+
The file is **assembled, not stored**: edit the originals. A hand-edited copy drifts from its
|
|
140
|
+
source within a week, and then nobody knows which one is real.
|
|
119
141
|
|
|
120
|
-
##
|
|
142
|
+
## Contributing a gate
|
|
121
143
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
144
|
+
The catalogue lives on other people's bruises. The procedure and the bar are in
|
|
145
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md): check for duplicates with `aqk find`, scaffold with
|
|
146
|
+
`aqk new`, add two samples, fill in four fields, run the machine. The filtering is done by
|
|
147
|
+
`tool/selfcheck/gates.sh`, not by a reviewer.
|
|
125
148
|
|
|
126
|
-
##
|
|
149
|
+
## The bruise journal
|
|
127
150
|
|
|
128
151
|
```bash
|
|
129
|
-
aqk note "
|
|
152
|
+
aqk note "the gate went red on correct code" # an entry without a conclusion is rejected
|
|
130
153
|
```
|
|
131
154
|
|
|
132
|
-
##
|
|
133
|
-
|
|
134
|
-
Задача целиком — в [`PROJECT.md`](PROJECT.md): что строим, четыре сценария, критерий успеха, что осталось.
|
|
155
|
+
## Honestly, where this stands
|
|
135
156
|
|
|
157
|
+
The full brief is in [`PROJECT.md`](PROJECT.md) (in Russian): what is being built, the four
|
|
158
|
+
scenarios, the success criterion, and what is left.
|
|
136
159
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
160
|
+
Version 1, one author. The kit holds **AQK-3** on itself: everything declared is executed by CI
|
|
161
|
+
on every push, two debt registries under a ratchet — `node tool/program.mjs doctor --run --min 1`.
|
|
162
|
+
As long as one person uses it, AQK is a nice acronym in a README. It starts being real when a
|
|
163
|
+
third, foreign project appears.
|
|
140
164
|
|
|
141
|
-
|
|
142
|
-
|
|
165
|
+
**A standard cannot be shipped first.** A specification ahead of practice is the thirty-first
|
|
166
|
+
abandoned repository with a manifest and zero users. The order is the other way round:
|
|
143
167
|
|
|
144
|
-
| # |
|
|
168
|
+
| # | Step | State |
|
|
145
169
|
|---|---|---|
|
|
146
|
-
| 1 |
|
|
147
|
-
| 2 | `doctor`
|
|
148
|
-
| 3 |
|
|
149
|
-
| 4 |
|
|
150
|
-
| 5 |
|
|
170
|
+
| 1 | live by this on our own projects | ⬜ measured: three of our own projects have no manifest |
|
|
171
|
+
| 2 | `doctor` computes the level | ✅ done |
|
|
172
|
+
| 3 | what settled is written up as a short spec | ✅ [`SPEC.md`](SPEC.md) |
|
|
173
|
+
| 4 | a third project — **someone else's** | ❌ the first honest signal, still missing |
|
|
174
|
+
| 5 | badge, site, talking to people | ❌ only after step four |
|
|
151
175
|
|
|
152
|
-
##
|
|
176
|
+
## The work queue
|
|
153
177
|
|
|
154
|
-
|
|
155
|
-
|
|
178
|
+
Lives in one place — [`PROJECT.md` §9](PROJECT.md). It is not repeated here: two lists drift
|
|
179
|
+
apart within a month, and then nobody knows which is real.
|
|
156
180
|
|
|
157
|
-
|
|
158
|
-
|
|
181
|
+
What is missing: a second user; per-command coverage of the commands that write to disk (they are
|
|
182
|
+
exercised by a clean-folder run, but not individually); a third — foreign — project.
|
|
159
183
|
|
|
160
184
|
MIT.
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# AQK — Agent Quality Kit
|
|
2
|
+
|
|
3
|
+
[English](README.md) · **Русский**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/agent-quality-kit)
|
|
6
|
+
[](https://github.com/arsen-ask-lx/Agent_Quality_Kit/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
**Стандарт готовности репозитория к тому, что код в нём пишет агент.** Обещание проекта
|
|
10
|
+
становится командой с кодом возврата — и его держит машина, а не чья-то добрая воля.
|
|
11
|
+
|
|
12
|
+
Что вообще должно быть на проекте, чтобы это было возможно, — словами, без привязки к языку и
|
|
13
|
+
инструменту: [«тёмная фабрика» и обязательный минимум](kit/docs/ai/project-baseline.md).
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx agent-quality-kit start # кода ещё нет: сторожа дня 0 сразу
|
|
17
|
+
npx agent-quality-kit doctor # код уже есть: уровень и что поставить
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Ставить ничего не нужно, `npx` скачает пакет сам (230 КБ). Свежая версия прямо из репозитория —
|
|
21
|
+
`npx github:arsen-ask-lx/Agent_Quality_Kit doctor`, но первый запуск такого вида молчит две-три
|
|
22
|
+
минуты: он клонирует репозиторий целиком.
|
|
23
|
+
|
|
24
|
+
**Что нужно.** Node 18+ и оболочка `sh` — она есть в macOS, Linux и WSL; на Windows подойдёт
|
|
25
|
+
Git Bash. Переносимые проверки написаны на `sh` намеренно: он есть везде, где собирают код.
|
|
26
|
+
|
|
27
|
+
**Не зависит от инструмента:** Claude Code, Codex, Cursor — и без ИИ тоже.
|
|
28
|
+
|
|
29
|
+
При первой установке на машине `init`/`start` один раз печатают ссылку на звезду и на «завести
|
|
30
|
+
Issue» — ничего не постится сама, только текст для человека, и больше не повторяется.
|
|
31
|
+
|
|
32
|
+
**Готовые правила ставятся отдельно и по желанию.** Переносимая проверка работает без них
|
|
33
|
+
всегда; если в проекте стоит `ruff`, `eslint` или `vulture`, запись возьмёт готовое правило —
|
|
34
|
+
оно точнее. Одна запись, `dead-code`, без готового инструмента не работает вовсе и честно
|
|
35
|
+
скрывается: граф вызовов поиском по тексту не построить.
|
|
36
|
+
|
|
37
|
+
## Как устроено
|
|
38
|
+
|
|
39
|
+
Весь стандарт — файл `.aqk.yml` в корне:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
aqk: 1
|
|
43
|
+
entry: [AGENTS.md] # что агент читает первым
|
|
44
|
+
rules: .aqk/rules # где стандарты
|
|
45
|
+
gates: # что обязано пройти — командами, не словами
|
|
46
|
+
lint: "npm run lint"
|
|
47
|
+
secrets-not-in-code: "bash gates/secrets-not-in-code/check.sh ."
|
|
48
|
+
samples: gates # красный и зелёный образец каждой записи
|
|
49
|
+
ratchets: ratchets # реестры долга: список может только укорачиваться
|
|
50
|
+
lessons: incidents # где копятся уроки
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Пустое поле — не заглушка, а честный ответ «ступень не пройдена»: `init` кладёт их пустыми,
|
|
54
|
+
а заполняются они по мере того, как появляется чем их заполнить.
|
|
55
|
+
|
|
56
|
+
**Если утверждение нельзя проверить машиной — его в стандарте нет.** Иначе значок означает
|
|
57
|
+
доверие к автору, а не факт.
|
|
58
|
+
|
|
59
|
+
## Четыре ступени
|
|
60
|
+
|
|
61
|
+
| Уровень | Требуется | Что доказано |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| **AQK-0** | манифест и точка входа | инструмент знает, что читать |
|
|
64
|
+
| **AQK-1** | правила есть, гейты объявлены командами | проверки исполняются |
|
|
65
|
+
| **AQK-2** | у гейтов красные и зелёные образцы, долг под храповиком | гейт ловит брак и молчит на исправном коде |
|
|
66
|
+
| **AQK-3** | журнал уроков с выводами | шишка не набивается дважды |
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
aqk doctor --run --min 1 # в конвейере: ошибка, если ниже AQK-1 ИЛИ упал хоть один гейт
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Поставить гейт
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
aqk find "печать в проде" # есть ли уже такой гейт — сверка по намерению
|
|
76
|
+
aqk doctor # что применимо к этому репозиторию и чего нет
|
|
77
|
+
aqk add secrets-not-in-code # копирует проверку и образцы в проект, объявляет в манифесте
|
|
78
|
+
aqk doctor --run # запускает объявленные гейты и показывает результат
|
|
79
|
+
aqk ratchet no-print-in-prod # старое — долг, новое не пускать
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Каждый `doctor --run` перезаписывает `.aqk/last-run.md` — короткий отчёт, что из объявленного
|
|
83
|
+
реально сработало и за сколько. Список гейтов в манифесте молчит о том, сколько из них живы
|
|
84
|
+
именно сейчас; отчёт — нет. Файл эфемерный, в `.gitignore` его стоит держать самому.
|
|
85
|
+
|
|
86
|
+
## Поймал ошибку, которую не поймал сторож
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
aqk why "файл вырос до девяти тысяч строк"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Ответ один из трёх, и выбирает его прогон, а не память: **сторожа не было** · **сторож есть,
|
|
93
|
+
но эту поломку не видит** · **сторож есть и ловит — значит его обошли**. Разница решает, что
|
|
94
|
+
чинить: саму проверку или её место в конвейере. Без прогона эти два случая неразличимы, и
|
|
95
|
+
чинят обычно не тот. При неуверенном совпадении команда не выбирает за тебя, а спрашивает.
|
|
96
|
+
|
|
97
|
+
**Храповик** нужен, когда правило вводят в проект, где старый код ему не соответствует.
|
|
98
|
+
Список нарушений снимается в реестр, гейт разрешает его **укорачивать** и запрещает удлинять.
|
|
99
|
+
Правило действует со дня установки, старый код трогать не надо.
|
|
100
|
+
|
|
101
|
+
`add` **копирует проверку в репозиторий**, а не ссылается на пакет: при установке через `npx`
|
|
102
|
+
пакет временный, и завтра команда в манифесте указывала бы в никуда.
|
|
103
|
+
|
|
104
|
+
## Чужой код в репозитории
|
|
105
|
+
|
|
106
|
+
Референс, вендоринг, сгенерированные клиенты — код лежит здесь, но написан не здесь. Сканирующие
|
|
107
|
+
проверки по нему не пойдут, если завести `.aqkignore` в корне: по шаблону на строку, `#` —
|
|
108
|
+
комментарий, звёздочка не переходит через `/`.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
# принесено из другого репозитория
|
|
112
|
+
third-party/
|
|
113
|
+
vendor/
|
|
114
|
+
*.generated.js
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`aqk report` печатает содержимое этого файла отдельным разделом. Скрытое молча — тот же класс,
|
|
118
|
+
что молчащий гейт: строка здесь означает, что защиты по этому пути нет и не будет.
|
|
119
|
+
|
|
120
|
+
## Каталог обещаний
|
|
121
|
+
|
|
122
|
+
`doctor` смотрит на репозиторий — языки, наличие гейтов — и показывает **только применимое**:
|
|
123
|
+
что уже держит машина, что применимо и не поставлено, что скрыто и почему. Каталог может
|
|
124
|
+
вырасти до сотен записей, конкретный проект по-прежнему увидит десяток.
|
|
125
|
+
|
|
126
|
+
Запись принимается, только если её арбитр краснеет на красном образце, молчит на зелёном и
|
|
127
|
+
назван реальный отказ, который она поймала. Проверяет это машина: `bash tool/selfcheck/gates.sh`.
|
|
128
|
+
|
|
129
|
+
## Методички одним файлом
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
aqk blob # собирает GOD_AI.md из kit/docs — чтобы разом отдать методички в чат
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Файл **собирается, а не хранится**: править надо оригиналы. Копия, которую правят руками, через
|
|
136
|
+
неделю расходится с источником, и непонятно, какая настоящая.
|
|
137
|
+
|
|
138
|
+
## Принести свой гейт
|
|
139
|
+
|
|
140
|
+
Каталог живёт чужими шишками. Порядок и порог — в [`CONTRIBUTING.md`](CONTRIBUTING.md):
|
|
141
|
+
сверься `aqk find`, заведи заготовку `aqk new`, положи два образца, заполни четыре поля,
|
|
142
|
+
прогони машиной. Отбор делает `tool/selfcheck/gates.sh`, а не рецензент.
|
|
143
|
+
|
|
144
|
+
## Журнал шишек
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
aqk note "гейт краснел на правильном коде" # запись без вывода не принимается
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Честно о состоянии
|
|
151
|
+
|
|
152
|
+
Задача целиком — в [`PROJECT.md`](PROJECT.md): что строим, четыре сценария, критерий успеха, что осталось.
|
|
153
|
+
|
|
154
|
+
Версия 1, один автор. Сам комплект держит **AQK-3**: всё объявленное прогоняется конвейером при
|
|
155
|
+
каждом пуше, два реестра долга под храповиком — `node tool/program.mjs doctor --run --min 1`.
|
|
156
|
+
Пока комплектом пользуется один человек, AQK — красивое слово в README. Он начнёт работать,
|
|
157
|
+
когда появится чужой третий проект.
|
|
158
|
+
|
|
159
|
+
**Стандарт нельзя выпустить первым.** Спецификация раньше практики — это тридцать первый
|
|
160
|
+
заброшенный репозиторий с манифестом и нулём пользователей. Порядок обратный:
|
|
161
|
+
|
|
162
|
+
| # | Шаг | Состояние |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| 1 | живём по этому на своих проектах | ⬜ измерено: у трёх своих проектов манифеста нет, уровень не заведён |
|
|
165
|
+
| 2 | `doctor` считает уровень | ✅ сделано |
|
|
166
|
+
| 3 | сложившееся записано как короткая спецификация | ✅ [`SPEC.md`](SPEC.md) |
|
|
167
|
+
| 4 | третий проект — **чужой** | ❌ первый честный сигнал, его ещё нет |
|
|
168
|
+
| 5 | значок, сайт, разговор с людьми | ❌ только после четвёртого шага |
|
|
169
|
+
|
|
170
|
+
## Очередь работ
|
|
171
|
+
|
|
172
|
+
Живёт в одном месте — [`PROJECT.md` §9](PROJECT.md). Список здесь не повторяется: два списка через месяц
|
|
173
|
+
расходятся, и непонятно, какой настоящий.
|
|
174
|
+
|
|
175
|
+
Чего нет: второго пользователя; покрытия команд, которые пишут на диск (проверены прогоном на
|
|
176
|
+
чистой папке, но не по отдельности); третьего — чужого — проекта.
|
|
177
|
+
|
|
178
|
+
MIT.
|
package/kit/gates/_skip.sh
CHANGED
|
@@ -21,11 +21,39 @@ migrations"
|
|
|
21
21
|
# (red-team тесты, что угодно) становился невидим для secrets-not-in-code во всех проектах,
|
|
22
22
|
# куда ставили гейт. Фильтр ниже смотрит на путь целиком: только `gates/<имя>/red|green/`,
|
|
23
23
|
# а не голое имя каталога.
|
|
24
|
+
# Список исключений САМОГО ПРОЕКТА: файл .aqkignore в корне, по шаблону на строку, «#» —
|
|
25
|
+
# комментарий. Нужен для кода, который лежит в репозитории, но написан не здесь: референс,
|
|
26
|
+
# вендоринг, сгенерированные клиенты. Без него единственным способом настройки была правка
|
|
27
|
+
# КОПИИ этого файла в проекте — то есть настройка правкой чужого файла, которую затирает
|
|
28
|
+
# следующий `aqk add`. Найдено первым чужим прогоном.
|
|
29
|
+
#
|
|
30
|
+
# Шаблон — фрагмент пути: `vendor/`, `apps/legacy`, `*.generated.js`. Звёздочка не переходит
|
|
31
|
+
# через «/», как в .gitignore, — иначе «src/*» прятало бы весь проект.
|
|
32
|
+
aqkignore_re() {
|
|
33
|
+
F="${1:-.}/.aqkignore"
|
|
34
|
+
[ -f "$F" ] || return 1
|
|
35
|
+
sed -e 's/#.*$//' -e 's|/*[[:space:]]*$||' -e 's/^[[:space:]]*//' "$F" |
|
|
36
|
+
grep -v '^$' |
|
|
37
|
+
sed -e 's/[][(){}.^$+?|\\]/\\&/g' -e 's/\*/[^\/]*/g' |
|
|
38
|
+
tr '\n' '|' | sed 's/|$//'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Один фильтр на два дела, и это осознанно: его зовут все семь сканирующих проверок, а их
|
|
42
|
+
# копии уже лежат в чужих проектах. Добавить сюда — значит, что обновление комплекта включает
|
|
43
|
+
# .aqkignore и у тех, кто ставил гейты раньше, без перекопирования их check.sh.
|
|
24
44
|
own_samples_filter() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
45
|
+
DIR0="${1:-}"
|
|
46
|
+
RE="$(aqkignore_re "$DIR0")"
|
|
47
|
+
case "$DIR0" in
|
|
48
|
+
# Цель проверки — сам образец: тогда прятать его нельзя, иначе гейт «пройдёт» на красном.
|
|
49
|
+
*/red|*/red/|*/green|*/green/) SAMPLES="cat" ;;
|
|
50
|
+
*) SAMPLES="grep -vE /gates/[^/]+/(red|green)(/|\$)" ;;
|
|
28
51
|
esac
|
|
52
|
+
if [ -n "$RE" ]; then
|
|
53
|
+
$SAMPLES | grep -vE "(^|/)($RE)(/|:|\$)"
|
|
54
|
+
else
|
|
55
|
+
$SAMPLES
|
|
56
|
+
fi
|
|
29
57
|
}
|
|
30
58
|
|
|
31
59
|
# Расширения, где `print` и маркеры долга — конструкции языка, а не текст. Проверять по ним
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
intent: код, который никто не вызывает, не остаётся в проекте
|
|
2
|
+
intent_en: code nobody calls does not stay in the project
|
|
2
3
|
|
|
3
4
|
# Только там, где есть готовый инструмент: переносимой проверки здесь быть не может, а
|
|
4
5
|
# показывать запись тем, кому её нечем исполнить, — значит показывать работу, которую
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# Читается программой; всё, что нельзя выполнить, живёт в README.md рядом.
|
|
3
3
|
|
|
4
4
|
intent: файлы, на которые ссылается точка входа, существуют на диске
|
|
5
|
+
intent_en: files the entry point links to actually exist on disk
|
|
5
6
|
|
|
6
7
|
# Когда запись показывается человеку. Отсутствие триггера сделало бы её шумом
|
|
7
8
|
# для тех, кого она не касается.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
intent: каждый объявленный гейт запускается конвейером, а не только руками
|
|
2
|
+
intent_en: every declared gate runs in the pipeline, not only by hand
|
|
2
3
|
|
|
3
4
|
# Условия складываются: запись касается только тех, у кого есть и гейты, и конвейер.
|
|
4
5
|
# Нет конвейера — сначала он, а не эта проверка.
|