@kirill.konshin/lint 0.6.2 → 0.6.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirill.konshin/lint",
3
3
  "description": "ESLint + Prettier + lint-staged config and AI agent rules/skills for monorepos",
4
- "version": "0.6.2",
4
+ "version": "0.6.3",
5
5
  "type": "module",
6
6
  "skipGenerate": true,
7
7
  "bin": {
@@ -57,7 +57,7 @@ Decided once, printed as dotenv lines (`AUDIT_RUN`, `AUDIT_SCOPE`, `AUDIT_GATING
57
57
  | merge-request | a merge request touching none | affected | cheap | gating |
58
58
  | default-branch | anything else | affected | expensive | gating |
59
59
 
60
- Every run reads on the cheap model. `AUDIT_MODEL_CHEAP`, `AUDIT_EFFORT_CHEAP`, `AUDIT_MODEL_EXPENSIVE` and `AUDIT_EFFORT_EXPENSIVE` override the defaults. `AUDIT_SLOTS` is how many workers a reading job runs at once: as many as `AUDIT_JOB_MEMORY` (default 2 GiB) holds at 600 MB a worker, never more than `AUDIT_WORKERS` (default 2). A merge request whose open changes cannot be classified fails the command rather than reading as one that touches nothing.
60
+ Every run reads on the cheap model. `AUDIT_MODEL_CHEAP`, `AUDIT_EFFORT_CHEAP`, `AUDIT_MODEL_EXPENSIVE` and `AUDIT_EFFORT_EXPENSIVE` override the defaults. `AUDIT_SLOTS` is how many workers a reading job runs at once: as many as `AUDIT_JOB_MEMORY` (default 2 GiB) holds at 300 MB a worker, never more than `AUDIT_WORKERS` (default 2). A merge request whose open changes cannot be classified fails the command rather than reading as one that touches nothing.
61
61
 
62
62
  ### Scope — `spec-tools scope`
63
63
 
@@ -70,7 +70,7 @@ Cases:
70
70
 
71
71
  ### Workers — `spec-tools workers [--complete|--verify]`
72
72
 
73
- One headless `claude --print` worker per part loads the `spec-verify` skill and writes its own findings file. In a parallel job (`CI_NODE_INDEX` of `CI_NODE_TOTAL`) it reads only its share: part p goes to job ((p − 1) mod total) + 1. `--complete` judges, as each part's next reader, exactly what the merge listed short; `--verify` puts every standing ERROR to one verifier that confirms it only when the divergence is real and critical. How many run at once follows the container's memory (600 MB a worker), never more than `AUDIT_WORKERS` (default 2), and each pass logs the job's memory peak against its limit; a worker past `AUDIT_WORKER_TIMEOUT` (20m) is killed and its part judged by the completion pass. A pass that changed any file outside the audit's outputs exits 1, naming the paths; a missing input exits 2.
73
+ One headless `claude --print` worker per part loads the `spec-verify` skill and writes its own findings file. In a parallel job (`CI_NODE_INDEX` of `CI_NODE_TOTAL`) it reads only its share: part p goes to job ((p − 1) mod total) + 1. `--complete` judges, as each part's next reader, exactly what the merge listed short; `--verify` puts every standing ERROR to one verifier that confirms it only when the divergence is real and critical. How many run at once follows the container's memory (300 MB a worker), never more than `AUDIT_WORKERS` (default 2), and each pass logs the job's memory peak against its limit; a worker past `AUDIT_WORKER_TIMEOUT` (20m) is killed and its part judged by the completion pass. A pass that changed any file outside the audit's outputs exits 1, naming the paths; a missing input exits 2.
74
74
 
75
75
  ### Merge — `spec-tools report [--gate] [--worktree]`
76
76
 
@@ -17,7 +17,24 @@ The jobs a GitLab repository runs around `spec-steward` and `spec-tools`. Names
17
17
 
18
18
  ## Getting the tools into an AI job
19
19
 
20
- An AI job's image carries `claude` and Node but no workspace install. The job that computes the scope runs with the workspace installed and hands the package's `skills/` on as an artifact: the self-contained CLI, `skills/spec-tools/scripts/cli.js`, and the skills its workers read. The AI jobs `needs:` that job and call the file with `node`; they run no setup.
20
+ An AI job needs Node and the Claude CLI, no workspace install. Pin the CLI rather than taking whatever an image carries: a model needs a CLI that knows it (its context window and its effort levels), and an older CLI fails a long worker with "Prompt is too long". Download Anthropic's release binary for the runner's platform, check it against the release manifest, and cache it per version:
21
+
22
+ ```yaml
23
+ .claude-code: &claude-code
24
+ - |
25
+ set -e
26
+ platform="linux-$(uname -m | sed 's/x86_64/x64/; s/aarch64/arm64/')"
27
+ dir=".claude-code/$CLAUDE_CODE_VERSION/$platform"
28
+ if [ ! -x "$dir/claude" ]; then
29
+ base="https://downloads.claude.ai/claude-code-releases/$CLAUDE_CODE_VERSION"
30
+ sum=$(curl -fsSL "$base/manifest.json" | node -e "let s='';process.stdin.on('data',(d)=>(s+=d)).on('end',()=>console.log(JSON.parse(s).platforms[process.argv[1]].checksum))" "$platform")
31
+ mkdir -p "$dir" && curl -fsSL "$base/$platform/claude" -o "$dir/claude.download"
32
+ echo "$sum $dir/claude.download" | sha256sum -c - && mv "$dir/claude.download" "$dir/claude" && chmod +x "$dir/claude"
33
+ fi
34
+ export PATH="$CI_PROJECT_DIR/$dir:$PATH"
35
+ ```
36
+
37
+ Cache `.claude-code/` keyed on `CLAUDE_CODE_VERSION`, and gitignore it. The job that computes the scope runs with the workspace installed and hands the package's `skills/` on as an artifact: the self-contained CLI, `skills/spec-tools/scripts/cli.js`, and the skills its workers read. The AI jobs `needs:` that job and call the file with `node`.
21
38
 
22
39
  `spec-tools scope` and `changed` load `typescript`, so they run in a job with the workspace installed.
23
40
 
@@ -70,11 +87,12 @@ spec-coverage:
70
87
  # reading left short, verify every ERROR, gate.
71
88
  spec-verify:
72
89
  stage: review
73
- image: <an image with claude and node>
90
+ image: <an image with node>
74
91
  needs: [spec-coverage]
75
92
  variables: { KUBERNETES_MEMORY_LIMIT: 8Gi, KUBERNETES_CPU_LIMIT: '4' } # AUDIT_JOB_MEMORY says the same
76
93
  allow_failure: { exit_codes: [3, 77] }
77
94
  script:
95
+ - *claude-code
78
96
  - node node_modules/@kirill.konshin/lint/skills/spec-tools/scripts/cli.js workers || echo "the completion pass reads what the reading left short"
79
97
  - node node_modules/@kirill.konshin/lint/skills/spec-tools/scripts/cli.js report
80
98
  - node node_modules/@kirill.konshin/lint/skills/spec-tools/scripts/cli.js workers --complete
@@ -87,10 +105,11 @@ spec-verify:
87
105
  # Any other skill-driven review: headless, then its verdict.
88
106
  some-review:
89
107
  stage: review
90
- image: <an image with claude and node>
108
+ image: <an image with node>
91
109
  needs: [spec-coverage]
92
110
  allow_failure: { exit_codes: [3, 77] }
93
111
  script:
112
+ - *claude-code
94
113
  - node node_modules/@kirill.konshin/lint/skills/spec-tools/scripts/cli.js run some-review --verdict some-review.md --advisory
95
114
  artifacts: { when: always, paths: [some-review.md, claude.jsonl, 'job-log-*.md'] }
96
115
 
@@ -3924,7 +3924,7 @@ var init_tier = __esmMin((() => {
3924
3924
  CHEAP_EFFORT = "high";
3925
3925
  EXPENSIVE_MODEL = "claude-sonnet-5-5";
3926
3926
  EXPENSIVE_EFFORT = "medium";
3927
- WORKER_BYTES = 600 * 1024 ** 2;
3927
+ WORKER_BYTES = 300 * 1024 ** 2;
3928
3928
  DEFAULT_JOB_MEMORY = 2 * 1024 ** 3;
3929
3929
  workersFor = (env, memory) => Math.max(1, Math.min(Number(env.AUDIT_WORKERS) || 2, Math.floor(memory / WORKER_BYTES)));
3930
3930
  dotenv = (t) => Object.entries(t).map(([key, value]) => `${key}=${value}`).join("\n") + "\n";