@yeison.restrepo.r/code-conductor 1.52.9 → 1.52.11
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
CHANGED
|
@@ -499,8 +499,6 @@ The backup and temp rules keep the installer's own backups and crash-stranded te
|
|
|
499
499
|
- **`[BUG-070]`, open:** the GitHub Actions workflows pin `actions/checkout` and `actions/setup-node` by tag rather than by commit SHA, so a moved tag would change what runs; the risk is low, since both actions are first-party and the records guard runs with a read-only token and no secrets. Until it is fixed, a fork can pin both actions to full commit SHAs in its own workflows.
|
|
500
500
|
- **`[BUG-071]`, open:** the OpenCode guard plugin forwards only `command` from OpenCode's `bash` call, so if that tool runs a command in another working directory, Guard 3 evaluates it as if it ran in the project root. Until it is fixed, treat Guard 3 under OpenCode as best-effort for commands that set their own working directory.
|
|
501
501
|
- **`[BUG-074]`, open:** the `/cc-orchestrate` role definitions disagree on when a task's tests are done: `code` may hand back `build_executed` on a red suite, `plan` requires each task to end green, and `qa` passes only on exit 0, so one suite result gates differently depending on the role. Until it is fixed, read a `build_executed` hand-back's reported suite exit code yourself and treat a non-zero one as not done.
|
|
502
|
-
- **`[BUG-078]`, open:** `scripts/orchestrate.mjs` builds a fix round's write scope with the approved plan included, so Guard 5 lets the fix-round `code` agent write to the plan and only the brief's instruction stops it; any change other than checkbox ticks still halts the run with `ORCH_APPROVED_DOC_CHANGED` on the next `install audit` or fix round, and ticks do not affect `tasks.done`. Until it is fixed, check after a fix round that the approved plan's checkboxes are unchanged.
|
|
503
|
-
- **`[BUG-079]`, open:** `scripts/orchestrate.mjs` stores every non-security hand-back's full SNAP in `.claude/memory/orchestrator-run.json` with a 64 KiB cap per SNAP but no cap on the total, so a plan of roughly 80 or more tasks with maximally sized hand-backs can push the run file past the hook's 10 MiB read cap, after which `readRunFile` returns null and Guard 6 downgrades from deny to warn for the rest of the run. Until it is fixed, keep orchestrated plans well under 80 tasks, or split a larger item into several runs.
|
|
504
502
|
- **The `P7` false positive** described under [Guard 3, and what it learned](#guard-3-and-what-it-learned) is still live.
|
|
505
503
|
- **A re-run against an untouched `project.md` prints a recovery hint it cannot prove is needed.** If you install, never write anything into `.claude/memory/project.md`, and install again, you get a line suggesting the file may have been overwritten by a pre-`1.30.0` re-run. It was not; it equals the stub because it was seeded and never edited. The check compares content and **cannot distinguish "seeded and untouched" from "clobbered"**, which is why the wording is hedged to "may have been" rather than "was". This residual is named and accepted in [`BUG-039`'s spec at `:129`](docs/superpowers/specs/2026-09-27-bug039-installer-host-owned-state-design.md), where the alternative (restoring from the host's own git history) was rejected as writing host files out of the host's history with new failure modes. A **fresh** install is silent, which the Quickstart shows.
|
|
506
504
|
- **Three open dossiers**, which are the evidence-collection pipeline working rather than a backlog: a session denial tally, one for interleaved-artifact reports, and an intermittent commit-hook hang in the `snap-build` suite. A dossier holds specimens until a mechanism is characterized by probe; an id is minted only when the written condition is met. `[BUG-047]` is what that pipeline produces when it completes: an out-of-scope note, then a dossier, then four specimens across four sessions, then a mint, then a release.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeison.restrepo.r/code-conductor",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.11",
|
|
4
4
|
"description": "A governance layer for Claude Code sessions: hooks that check an agent's commands before they run, a spec-first workflow, and project memory the next session reads.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentic-development",
|
|
@@ -5,7 +5,7 @@ tools: Read, Grep, Glob, Write, Edit, Bash
|
|
|
5
5
|
default-model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are the `code` role of a code-conductor orchestrated run. The orchestrator dispatched you with a brief naming one task of the approved plan, and installed your band envelope at `.claude/memory/band-envelope.json`. Read the envelope first: its `ops.scope` is the task's files plus the plan file.
|
|
8
|
+
You are the `code` role of a code-conductor orchestrated run. The orchestrator dispatched you with a brief naming one task of the approved plan, and installed your band envelope at `.claude/memory/band-envelope.json`. Read the envelope first: its `ops.scope` is the task's files plus the plan file; in a fix round it is the files the review names, without the plan.
|
|
9
9
|
|
|
10
10
|
## Your job
|
|
11
11
|
|
|
@@ -34,7 +34,7 @@ A halt stops the run (D12, amended by FEAT-055). Recovery is `node "$S/orchestra
|
|
|
34
34
|
|
|
35
35
|
`install code|audit|qa` halts `ORCH_APPROVED_DOC_CHANGED` when the approved spec or plan changed after its approval (a ticked plan checkbox is not a change), and `ORCH_APPROVAL_UNHASHED` on a run whose approvals were recorded before FEAT-056. Recovery for both is `end`, then `start`. `install security` halts the same two codes.
|
|
36
36
|
|
|
37
|
-
`handback <role>` halts `ORCH_HANDBACK_SCOPE_MISMATCH` when the hand-back's `ops.scope` is not the scope `install` wrote for that position, entry for entry and in the same order, or when `audit`, `security` or `qa`, which are installed with no scope, hand back one; and `ORCH_HANDBACK_OUT_OF_SCOPE` when a path in `ops.f` is absolute, has an empty, `.` or `..` segment, or lies outside that scope. The script recomputes the scope from the plan and the run's pinned folders; it never reads it back from `.claude/memory/band-envelope.json`. Neither halt records the hand-back. For both, name the hand-back file you passed: it is what the owner reads next. Recovery is `resume` or `end`, then `start`.
|
|
37
|
+
`handback <role>` halts `ORCH_HANDBACK_SCOPE_MISMATCH` when the hand-back's `ops.scope` is not the scope `install` wrote for that position, entry for entry and in the same order, or when `audit`, `security` or `qa`, which are installed with no scope, hand back one; and `ORCH_HANDBACK_OUT_OF_SCOPE` when a path in `ops.f` is absolute, has an empty, `.` or `..` segment, or lies outside that scope. The script recomputes the scope from the plan and the run's pinned folders; it never reads it back from `.claude/memory/band-envelope.json`. Neither halt records the hand-back. For both, name the hand-back file you passed: it is what the owner reads next. Recovery is `resume` or `end`, then `start`. `handback <role>` also halts `ORCH_RUN_FILE_FULL` when recording the hand-back would carry the run file past `RUN_FILE_MAX_BYTES` (8388608 bytes), the bound that keeps it under the hooks' read cap; the hand-back is not recorded, and recovery is `end`, then `start` with a smaller plan, because `resume` keeps the stored records and the redone hand-back halts again.
|
|
38
38
|
|
|
39
39
|
`handback audit` halts `ORCH_VERDICT_MISSING`, `ORCH_VERDICT_INVALID` or `ORCH_VERDICT_INCONSISTENT` when the audit report's `VERDICT:` line is absent, malformed, misplaced or contradicts its findings; `ORCH_AUDIT_RETURN` when the audit returned the change and the run has no fix rounds left; `ORCH_AUDIT_ESCALATE` when the audit escalated a decision to the owner, at any round; and `ORCH_FIX_SCOPE_UNAPPROVED` when a blocker or major finding of a returned audit names a file outside the approved plan's task files, or the approved spec or plan. For those six, also name `.conductor/handback/audit-<round>.txt`: its findings are what the owner reads next. `handback qa` halts `ORCH_GATE_WITHHELD` when the run's last audit entry carries no `VERDICT: APPROVE`. Recovery for all seven is `end`, then `start`.
|
|
40
40
|
|
package/scripts/orchestrate.mjs
CHANGED
|
@@ -110,6 +110,8 @@ export const DELEGATE_DIR = '.conductor/delegate';
|
|
|
110
110
|
export const AUDIT_ROUNDS_DEFAULT = 2;
|
|
111
111
|
const AUDIT_ROUNDS_MAX = 5;
|
|
112
112
|
const SNAP_STORE_MAX_BYTES = 64 * 1024;
|
|
113
|
+
// BUG-079: the hooks stop reading the run file at 10 MiB; the 2 MiB below that is for the unchecked writes after a hand-back (a halt, approvals, dispatch fields).
|
|
114
|
+
export const RUN_FILE_MAX_BYTES = 8 * 1024 * 1024;
|
|
113
115
|
const isAuditRounds = (n) => Number.isInteger(n) && n >= 0 && n <= AUDIT_ROUNDS_MAX;
|
|
114
116
|
// FEAT-053: the Agent tool's model aliases plus inherit; the one list start, the profiles and isValidRun are checked against.
|
|
115
117
|
export const MODEL_ALIASES = ['opus', 'sonnet', 'haiku', 'inherit'];
|
|
@@ -236,7 +238,18 @@ function readRun(root) {
|
|
|
236
238
|
return run;
|
|
237
239
|
}
|
|
238
240
|
|
|
239
|
-
const
|
|
241
|
+
const serializeRun = (run) => JSON.stringify(run, null, 2) + '\n';
|
|
242
|
+
const saveRun = (root, run) => writeAtomic(join(root, RUN_FILE), serializeRun(run));
|
|
243
|
+
|
|
244
|
+
// BUG-079: a hand-back stores its SNAP, so it is the write that could carry the run file past the hooks' read cap.
|
|
245
|
+
function saveHandedBackRun(root, run, role) {
|
|
246
|
+
const text = serializeRun(run);
|
|
247
|
+
const bytes = Buffer.byteLength(text);
|
|
248
|
+
if (bytes > RUN_FILE_MAX_BYTES) {
|
|
249
|
+
throw new Halt('ORCH_RUN_FILE_FULL', `the run file would be ${bytes} bytes with this ${role} hand-back, over the ${RUN_FILE_MAX_BYTES}-byte bound that keeps it readable by the hooks; end, then start with a smaller plan`);
|
|
250
|
+
}
|
|
251
|
+
writeAtomic(join(root, RUN_FILE), text);
|
|
252
|
+
}
|
|
240
253
|
|
|
241
254
|
// Every verb but start, resume and end drives a run that must exist, be this session's, and not be halted.
|
|
242
255
|
function liveRun(root, sessionId) {
|
|
@@ -308,24 +321,30 @@ export function extractTasks(planText) {
|
|
|
308
321
|
}
|
|
309
322
|
|
|
310
323
|
// D9: an empty scope is a plan defect, never a read-only fallback; scopes are never truncated.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
324
|
+
// The empty check reads the declared files, so the plan alone never passes as a task's scope.
|
|
325
|
+
function checkedScope(id, files, added) {
|
|
326
|
+
if (files.length === 0) throw new Halt('ORCH_EMPTY_SCOPE', `${id} declares no files`);
|
|
327
|
+
const scope = [...new Set([...files, ...added])];
|
|
314
328
|
const [cap, elemCap] = V3_CAPS['ops.scope'];
|
|
315
|
-
if (scope.length > cap) throw new Halt('ORCH_SCOPE_OVER_CAP', `${
|
|
329
|
+
if (scope.length > cap) throw new Halt('ORCH_SCOPE_OVER_CAP', `${id} needs ${scope.length} scope entries; the cap is ${cap}`);
|
|
316
330
|
const long = scope.find((p) => elementLength(p) > elemCap);
|
|
317
|
-
if (long) throw new Halt('ORCH_SCOPE_OVER_CAP', `${
|
|
331
|
+
if (long) throw new Halt('ORCH_SCOPE_OVER_CAP', `${id} has a ${elementLength(long)}-character path; the cap is ${elemCap}`);
|
|
318
332
|
return scope;
|
|
319
333
|
}
|
|
320
334
|
|
|
335
|
+
export function taskScope(task, planRel) {
|
|
336
|
+
return checkedScope(task.id, task.files, [planRel]);
|
|
337
|
+
}
|
|
338
|
+
|
|
321
339
|
// FEAT-057: the audit text is not owner-approved, so it may name only files the approved plan's tasks
|
|
322
340
|
// declare, never the approved documents themselves (owner decision, 2026-11-13).
|
|
341
|
+
// A fix round ticks no boxes, so the plan stays out of its write scope and Guard 5 enforces that (BUG-078).
|
|
323
342
|
function fixScope(root, run, files, round) {
|
|
324
343
|
const planned = new Set(extractTasks(readDoc(root, run.plan, `cannot read ${run.plan}`).toString('utf8')).flatMap((t) => t.files));
|
|
325
344
|
const approved = [run.plan, run.approvals.spec?.path];
|
|
326
345
|
const outside = files.find((p) => typeof p !== 'string' || !planned.has(p) || approved.includes(p));
|
|
327
346
|
if (outside !== undefined) throw new Halt('ORCH_FIX_SCOPE_UNAPPROVED', `${outside} is not a file the approved plan declares; the fix scope stays inside the plan`);
|
|
328
|
-
return
|
|
347
|
+
return checkedScope(`fix round ${round}`, files, []);
|
|
329
348
|
}
|
|
330
349
|
|
|
331
350
|
// FEAT-047: one glob per role, checked against the element cap once, at start.
|
|
@@ -1014,7 +1033,7 @@ async function handback(root, sessionId, role, bytes) {
|
|
|
1014
1033
|
if (role === 'security') return securityHandback(root, run, env.ops.gate, text);
|
|
1015
1034
|
const verdict = role === 'audit' ? parseVerdict(text) : null;
|
|
1016
1035
|
const recorded = recordHandback(run, role, env.ops.gate, verdict?.verdict, { snap });
|
|
1017
|
-
|
|
1036
|
+
saveHandedBackRun(root, recorded, role);
|
|
1018
1037
|
// Saved first, so the halt cli records lands on top of the audit entry (FEAT-060, FEAT-057).
|
|
1019
1038
|
if (verdict && verdict.verdict !== 'APPROVE') return auditFix(root, recorded, verdict, bytes);
|
|
1020
1039
|
const note = recorded.handbacks.at(-1).security === SECURITY_NOT_CONFIGURED ? `; security=${SECURITY_NOT_CONFIGURED}` : '';
|