@warren-dean/code-kit 0.31.0 → 0.31.1

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.
@@ -9,7 +9,7 @@
9
9
  "name": "code-kit",
10
10
  "source": "./",
11
11
  "description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
12
- "version": "0.31.0",
12
+ "version": "0.31.1",
13
13
  "category": "development",
14
14
  "tags": ["guardrails", "architecture", "lanes", "layers", "spec-driven", "ci", "multi-agent"],
15
15
  "license": "MIT"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-kit",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Keeps AI coding agents inside your project's rules, from idea to merged code: spec design, lanes, layer rules, protected paths with an approval log, spec-check and design gates, proof-before-finish checks, dispatch, review, build status and CI verification, configured per project from its docs",
5
5
  "author": {
6
6
  "name": "Warren Langeveldt"
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  What changed in each release of code-kit, newest first. Versions follow the plugin manifest and the npm package `@warren-dean/code-kit`. Each release is also on [GitHub Releases](https://github.com/warrendeanlangeveldt/code-kit/releases).
4
4
 
5
+ ## 0.31.1 (2026-11-05)
6
+
7
+ - **`next` in a working session says whose step it is.** When another session leads the project, `code-kit next` and `/code-kit:next` handed a working session the lead's step, such as a dispatch. The session went on to write the lead's contracts and was refused at every edit. It now gets the step `working`: which session leads and what its next step is, and what this session does instead (a task of its own, recorded with `code-kit task`, in a worktree of its own).
8
+
5
9
  ## 0.31.0 (2026-11-05)
6
10
 
7
11
  - **The project's own workspace packages are no new dependency.** `pnpm add @scope/pkg@workspace:*` (and `link:`, `file:` and `portal:` specs) adds one of the project's own packages, from no registry, but was refused as a new dependency that needs an approval. A registry package in the same command still needs its own.
package/bin/code-kit.mjs CHANGED
@@ -2268,10 +2268,24 @@ function reconcileCommand(id) {
2268
2268
  }
2269
2269
 
2270
2270
  function next() {
2271
- const step = nextStep(resolve('.'), (config) => findBase(config, false));
2271
+ const root = resolve('.');
2272
+ let step = nextStep(root, (config) => findBase(config, false));
2273
+ // SESS-2: the project's steps are the lead's. A working session that asks is told whose they are,
2274
+ // and what's its own, instead of being handed a dispatch or a review it may not do.
2275
+ const me = callerSession ? readSession(root, callerSession) : null;
2276
+ const lead = leadSession(root);
2277
+ if (me && lead && lead.id !== me.id && !['wait', 'done'].includes(step.step))
2278
+ step = {
2279
+ ...step,
2280
+ step: 'working',
2281
+ lead: { session: lead.id, step: step.step, args: step.args ?? null },
2282
+ args: null,
2283
+ then: [],
2284
+ why: `This is a working session: session ${shortSession(lead.id)} leads the project, and the next step, ${step.step}${step.args ? ` ${step.args}` : ''}, is the lead's (${step.why}). Here, do a task of your own, in a worktree of your own: record it with \`code-kit task "<what>" --touches "<globs>"\` first. To lead from this session instead, ask the person to make it the lead.`,
2285
+ };
2272
2286
  if (flag('--json')) return out(JSON.stringify(step, null, 2));
2273
2287
  const command = (s, args) => `/code-kit:${s}${args ? ` ${args}` : ''}`;
2274
- const actionable = !['wait', 'done'].includes(step.step);
2288
+ const actionable = !['wait', 'done', 'working'].includes(step.step);
2275
2289
  out(actionable ? `Next: ${command(step.step, step.args)}` : `Next: ${step.step}`);
2276
2290
  out(`Why: ${step.why}`);
2277
2291
  for (const t of step.then) out(`Then: ${command(t.step, t.args)}`);
@@ -23,6 +23,7 @@ export function nextText(step) {
23
23
  if (!step) return null;
24
24
  if (step.step === 'done') return 'nothing: every story is done';
25
25
  if (step.step === 'wait') return `waiting: ${step.why}`;
26
+ if (step.step === 'working') return `the lead's: ${step.lead?.step ?? 'its next step'}`;
26
27
  const then = (step.then ?? []).map((t) => stepLabel(t));
27
28
  const label = ['spec-design', 'init', 'check'].includes(step.step)
28
29
  ? `${step.step} (yours to run)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warren-dean/code-kit",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Keeps AI coding agents inside your project's rules: lanes, layer rules, protected paths and proof before finish, enforced by Claude Code hooks and in CI",
5
5
  "license": "MIT",
6
6
  "author": "Warren Langeveldt",
@@ -17,6 +17,7 @@ It returns `step`, `why`, `args`, `then` (steps that can follow straight after)
17
17
 
18
18
  | State | Step |
19
19
  | ------------------------------------------------------------ | --------------------------------------------------------- |
20
+ | This is a working session (another session leads) | working: the step is the lead's, not this session's |
20
21
  | Invalid config | `check`, then fix the config |
21
22
  | No config, a draft waiting | `init`, to show it for approval |
22
23
  | No config, a spec still being shaped (brief not `ready`) | `spec-design`, resuming |
@@ -47,6 +48,7 @@ Run the named skill with the Skill tool: `code-kit:<step>`, with `args` (and the
47
48
  - **`update`:** run `code-kit:init`. `why` names what the setup is missing (the design gate, design stories, a QA lane, a security reviewer); init adds those, shows the person the difference, and sets `"setup": 3`. Until then no new story starts; work already started goes on to review and merge.
48
49
  - **`instructions`:** there's no skill to run. With `args` `write`, run `code-kit instructions --write`. With `merge`, some files were written before code-kit marked its part: run `code-kit instructions` to list them, replace each old part with what `code-kit instructions show lead` (CLAUDE.md) or `show lane <lane>` (that lane's agent file) prints, keep every line the project wrote itself outside the markers, then run `--write` for the rest. Commit it on a branch and merge it like your own stories.
49
50
  - **`lead`:** there's no skill to run. Build each story yourself, on the branch `lead/st-<n>`: spec-check it first if it cites requirements, do the work, commit, then run `code-kit:review` on the branch like any other. A spike's result goes in the docs it names.
51
+ - **`working`:** another session leads the project, and the step (`lead.step` in the JSON) is its own, not this one's. Don't dispatch, review, merge or write contracts here. Tell the person which session leads and what its step is. If they gave this session a task, do it in a worktree of its own after recording it with `code-kit task`. If they want this session to lead instead, they make it the lead.
50
52
  - **`wait`:** say which stories are being built and on which branches, and which ready stories wait for their lane (a lane runs one story at a time), then stop. When a lane agent finishes, its notification arrives in this session; run this skill again then. If a story has been in progress with no agent running (the session ended, or the agent stopped without committing), dispatch it again.
51
53
  - **`done`:** give the `status` summary in a few lines, then offer to run spec-design for the next milestone or feature.
52
54
 
@@ -57,7 +59,7 @@ After a step finishes, run `next --json` again and carry on with the new step, w
57
59
  - a skill asks the person questions (spec-design's rounds, spec-check's blocking questions, review's scope questions);
58
60
  - something needs the person's approval (init's draft, an approval that's theirs: `requests --json` marks it `by: "person"`). What a lane asks for that's yours (`by: "lead"`) you decide with `/code-kit:decide`, without stopping. If the config has `approvals.lead`, ask for it in chat: when they approve in their own message, record it with the `code-kit approve` command the refusal names (their words as the reason) and carry on;
59
61
  - a person has to act: merge a pull request to a protected branch, add a CI secret;
60
- - the step is `wait` or `done`;
62
+ - the step is `wait`, `done` or `working`;
61
63
  - the same step comes back twice in a row with nothing changed. Report what's stuck instead of looping.
62
64
 
63
65
  **Under vibe** (`harness.autonomy` is `vibe`), you're the product owner too, and only the last two stop you. Answer spec-design's, spec-check's and review's questions yourself, from the brief, the specs and the principles, and record each in the brief's decision log with why. Every approval is yours (`by: "lead"`, with `--delegated`); merge and push as the queue says. What only the person can give (an account with a service provider, an API key or secret, a payment, an act outside the repository) you ask with `code-kit ask "…" --needs account|key|payment|outside`, and you build everything else meanwhile: behind the setting the key will fill, against a local or test stand-in, with the step to switch it on in the story's notes.