@codedrifters/configulator 0.0.286 → 0.0.288

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/lib/index.d.mts CHANGED
@@ -364,11 +364,6 @@ interface AgentSubAgent {
364
364
  * Rendered to the platform-specific sub-agent config.
365
365
  */
366
366
  readonly mcpServers?: Readonly<Record<string, McpServerConfig>>;
367
- /**
368
- * Sub-agents this agent can invoke/delegate to.
369
- * @example ['test-writer', 'code-reviewer']
370
- */
371
- readonly canDelegateToAgents?: ReadonlyArray<string>;
372
367
  /** Optional per-platform overrides for this sub-agent. */
373
368
  readonly platforms?: AgentSubAgentPlatformOverrides;
374
369
  }
@@ -1698,7 +1693,7 @@ interface ScopeGateConfig {
1698
1693
  * drifts.
1699
1694
  *
1700
1695
  * The counter persists in a small gitignored JSON state file
1701
- * (default `.claude/state/orchestrator-runs.json`). Every orchestrator
1696
+ * (default `.state/orchestrator-runs.json`). Every orchestrator
1702
1697
  * invocation ticks the counter once and classifies the run based on
1703
1698
  * `runCounter % (ratio + 1) == 0` — the `ratio + 1`th run in every
1704
1699
  * cycle is a housekeeping run, all others dispatch.
@@ -1742,7 +1737,7 @@ interface RunRatioConfig {
1742
1737
  * session maintains its own counter.
1743
1738
  *
1744
1739
  * Must be a non-empty relative path (no leading `/`). Defaults to
1745
- * `.claude/state/orchestrator-runs.json`.
1740
+ * `.state/orchestrator-runs.json`.
1746
1741
  */
1747
1742
  readonly stateFilePath?: string;
1748
1743
  /**
@@ -2837,7 +2832,7 @@ interface AgentConfigOptions {
2837
2832
  * When the whole config is omitted, the orchestrator ships with
2838
2833
  * openhi's published 4:1 defaults (four dispatch runs, one
2839
2834
  * housekeeping run, state file at
2840
- * `.claude/state/orchestrator-runs.json`, `opus` / `sonnet`
2835
+ * `.state/orchestrator-runs.json`, `opus` / `sonnet`
2841
2836
  * recommended models).
2842
2837
  *
2843
2838
  * Supply `ratio` to change the cadence, `stateFilePath` to move
@@ -3692,7 +3687,7 @@ declare const DEFAULT_DISPATCH_TO_HOUSEKEEPING_RATIO = 4;
3692
3687
  *
3693
3688
  * @see RunRatioConfig
3694
3689
  */
3695
- declare const DEFAULT_STATE_FILE_PATH = ".claude/state/orchestrator-runs.json";
3690
+ declare const DEFAULT_STATE_FILE_PATH = ".state/orchestrator-runs.json";
3696
3691
  /**
3697
3692
  * Default recommended model label for dispatch runs. Rendered into
3698
3693
  * the orchestrator-conventions rule so agents and humans can read the
@@ -4314,7 +4309,7 @@ declare function renderUnblockDependentsScript(ud: ResolvedUnblockDependents): s
4314
4309
  * (small: ≤3 AC + ≤2 sources; medium: ≤6 AC + ≤5 sources;
4315
4310
  * auto-file off) when the caller omits them. Run-ratio settings
4316
4311
  * default to the openhi 4:1 cadence with the counter persisted at
4317
- * `.claude/state/orchestrator-runs.json`. Pre-flight settings default
4312
+ * `.state/orchestrator-runs.json`. Pre-flight settings default
4318
4313
  * to vortex's step 0b contract (enabled, delegated to the
4319
4314
  * `pr-reviewer` sub-agent, squash merges, linked-issue keyword
4320
4315
  * required).
@@ -4604,11 +4599,10 @@ declare const DEFAULT_PROGRESS_FILES_ENABLED = true;
4604
4599
  * `<stateDir>/<filename>` where `<filename>` is produced from
4605
4600
  * `filenamePattern` at runtime.
4606
4601
  *
4607
- * Lives at the top-level `.state/` directory rather than under
4608
- * `.claude/state/` so the path stays harness-neutral — any agent
4609
- * runtime (Claude Code, Cursor, a bespoke worker) can read and
4610
- * write the same progress files without having to scope under a
4611
- * Claude-specific tree.
4602
+ * Lives at the top-level `.state/` directory so the path stays
4603
+ * harness-neutral — any agent runtime (Claude Code, Cursor, a
4604
+ * bespoke worker) can read and write the same progress files
4605
+ * without having to scope under a harness-specific tree.
4612
4606
  *
4613
4607
  * @see ProgressFilesConfig
4614
4608
  */
@@ -6583,7 +6577,7 @@ declare function compileFencedSamples(options?: CompileFencedSamplesOptions): Ar
6583
6577
  * The report is the durable output of Phase 1 (Scan) of the docs-sync
6584
6578
  * pipeline (parent epic #448). Phase 1 walks the repo, runs every
6585
6579
  * registered drift check, and persists a single combined report to
6586
- * `.claude/state/docs-sync/<N>-audit.json` (where `<N>` is the
6580
+ * `.state/docs-sync/<N>-audit.json` (where `<N>` is the
6587
6581
  * tracking-issue number). Phase 2 (Fix) reads the persisted report
6588
6582
  * and applies mechanical fixes — the two phases never share an
6589
6583
  * in-memory handle, so the JSON shape on disk is the contract
@@ -6863,7 +6857,7 @@ type AuditFinding = ApiDiffFinding | TsdocCoverageFinding | ReferenceMismatchFin
6863
6857
  declare const DOCS_SYNC_AUDIT_SCHEMA_VERSION = 1;
6864
6858
  /**
6865
6859
  * Top-level audit-report shape persisted to
6866
- * `.claude/state/docs-sync/<N>-audit.json`. The category-keyed
6860
+ * `.state/docs-sync/<N>-audit.json`. The category-keyed
6867
6861
  * arrays are the durable surface; the flat `findings` array is a
6868
6862
  * convenience aggregation of the same records.
6869
6863
  */
@@ -6942,9 +6936,9 @@ declare function auditReportJsonSchema(): Record<string, unknown>;
6942
6936
  /**
6943
6937
  * Default subdirectory beneath the repo root where audit reports are
6944
6938
  * persisted. Mirrors the path declared on issue #518's acceptance
6945
- * criteria: `.claude/state/docs-sync/<N>-audit.json`.
6939
+ * criteria: `.state/docs-sync/<N>-audit.json`.
6946
6940
  */
6947
- declare const DEFAULT_AUDIT_REPORT_DIR = ".claude/state/docs-sync";
6941
+ declare const DEFAULT_AUDIT_REPORT_DIR = ".state/docs-sync";
6948
6942
  /**
6949
6943
  * Stable iteration order for category keys. Matches the order they
6950
6944
  * appear in the persisted report and the order they ran during the
@@ -7044,7 +7038,7 @@ interface RunScanOptions {
7044
7038
  * {@link RunScanOptions.repoRoot}). Defaults to
7045
7039
  * {@link DEFAULT_AUDIT_REPORT_DIR}.
7046
7040
  *
7047
- * @default ".claude/state/docs-sync"
7041
+ * @default ".state/docs-sync"
7048
7042
  */
7049
7043
  readonly reportDir?: string;
7050
7044
  }
package/lib/index.d.ts CHANGED
@@ -413,11 +413,6 @@ interface AgentSubAgent {
413
413
  * Rendered to the platform-specific sub-agent config.
414
414
  */
415
415
  readonly mcpServers?: Readonly<Record<string, McpServerConfig>>;
416
- /**
417
- * Sub-agents this agent can invoke/delegate to.
418
- * @example ['test-writer', 'code-reviewer']
419
- */
420
- readonly canDelegateToAgents?: ReadonlyArray<string>;
421
416
  /** Optional per-platform overrides for this sub-agent. */
422
417
  readonly platforms?: AgentSubAgentPlatformOverrides;
423
418
  }
@@ -1747,7 +1742,7 @@ interface ScopeGateConfig {
1747
1742
  * drifts.
1748
1743
  *
1749
1744
  * The counter persists in a small gitignored JSON state file
1750
- * (default `.claude/state/orchestrator-runs.json`). Every orchestrator
1745
+ * (default `.state/orchestrator-runs.json`). Every orchestrator
1751
1746
  * invocation ticks the counter once and classifies the run based on
1752
1747
  * `runCounter % (ratio + 1) == 0` — the `ratio + 1`th run in every
1753
1748
  * cycle is a housekeeping run, all others dispatch.
@@ -1791,7 +1786,7 @@ interface RunRatioConfig {
1791
1786
  * session maintains its own counter.
1792
1787
  *
1793
1788
  * Must be a non-empty relative path (no leading `/`). Defaults to
1794
- * `.claude/state/orchestrator-runs.json`.
1789
+ * `.state/orchestrator-runs.json`.
1795
1790
  */
1796
1791
  readonly stateFilePath?: string;
1797
1792
  /**
@@ -2886,7 +2881,7 @@ interface AgentConfigOptions {
2886
2881
  * When the whole config is omitted, the orchestrator ships with
2887
2882
  * openhi's published 4:1 defaults (four dispatch runs, one
2888
2883
  * housekeeping run, state file at
2889
- * `.claude/state/orchestrator-runs.json`, `opus` / `sonnet`
2884
+ * `.state/orchestrator-runs.json`, `opus` / `sonnet`
2890
2885
  * recommended models).
2891
2886
  *
2892
2887
  * Supply `ratio` to change the cadence, `stateFilePath` to move
@@ -3741,7 +3736,7 @@ declare const DEFAULT_DISPATCH_TO_HOUSEKEEPING_RATIO = 4;
3741
3736
  *
3742
3737
  * @see RunRatioConfig
3743
3738
  */
3744
- declare const DEFAULT_STATE_FILE_PATH = ".claude/state/orchestrator-runs.json";
3739
+ declare const DEFAULT_STATE_FILE_PATH = ".state/orchestrator-runs.json";
3745
3740
  /**
3746
3741
  * Default recommended model label for dispatch runs. Rendered into
3747
3742
  * the orchestrator-conventions rule so agents and humans can read the
@@ -4363,7 +4358,7 @@ declare function renderUnblockDependentsScript(ud: ResolvedUnblockDependents): s
4363
4358
  * (small: ≤3 AC + ≤2 sources; medium: ≤6 AC + ≤5 sources;
4364
4359
  * auto-file off) when the caller omits them. Run-ratio settings
4365
4360
  * default to the openhi 4:1 cadence with the counter persisted at
4366
- * `.claude/state/orchestrator-runs.json`. Pre-flight settings default
4361
+ * `.state/orchestrator-runs.json`. Pre-flight settings default
4367
4362
  * to vortex's step 0b contract (enabled, delegated to the
4368
4363
  * `pr-reviewer` sub-agent, squash merges, linked-issue keyword
4369
4364
  * required).
@@ -4653,11 +4648,10 @@ declare const DEFAULT_PROGRESS_FILES_ENABLED = true;
4653
4648
  * `<stateDir>/<filename>` where `<filename>` is produced from
4654
4649
  * `filenamePattern` at runtime.
4655
4650
  *
4656
- * Lives at the top-level `.state/` directory rather than under
4657
- * `.claude/state/` so the path stays harness-neutral — any agent
4658
- * runtime (Claude Code, Cursor, a bespoke worker) can read and
4659
- * write the same progress files without having to scope under a
4660
- * Claude-specific tree.
4651
+ * Lives at the top-level `.state/` directory so the path stays
4652
+ * harness-neutral — any agent runtime (Claude Code, Cursor, a
4653
+ * bespoke worker) can read and write the same progress files
4654
+ * without having to scope under a harness-specific tree.
4661
4655
  *
4662
4656
  * @see ProgressFilesConfig
4663
4657
  */
@@ -6632,7 +6626,7 @@ declare function compileFencedSamples(options?: CompileFencedSamplesOptions): Ar
6632
6626
  * The report is the durable output of Phase 1 (Scan) of the docs-sync
6633
6627
  * pipeline (parent epic #448). Phase 1 walks the repo, runs every
6634
6628
  * registered drift check, and persists a single combined report to
6635
- * `.claude/state/docs-sync/<N>-audit.json` (where `<N>` is the
6629
+ * `.state/docs-sync/<N>-audit.json` (where `<N>` is the
6636
6630
  * tracking-issue number). Phase 2 (Fix) reads the persisted report
6637
6631
  * and applies mechanical fixes — the two phases never share an
6638
6632
  * in-memory handle, so the JSON shape on disk is the contract
@@ -6912,7 +6906,7 @@ type AuditFinding = ApiDiffFinding | TsdocCoverageFinding | ReferenceMismatchFin
6912
6906
  declare const DOCS_SYNC_AUDIT_SCHEMA_VERSION = 1;
6913
6907
  /**
6914
6908
  * Top-level audit-report shape persisted to
6915
- * `.claude/state/docs-sync/<N>-audit.json`. The category-keyed
6909
+ * `.state/docs-sync/<N>-audit.json`. The category-keyed
6916
6910
  * arrays are the durable surface; the flat `findings` array is a
6917
6911
  * convenience aggregation of the same records.
6918
6912
  */
@@ -6991,9 +6985,9 @@ declare function auditReportJsonSchema(): Record<string, unknown>;
6991
6985
  /**
6992
6986
  * Default subdirectory beneath the repo root where audit reports are
6993
6987
  * persisted. Mirrors the path declared on issue #518's acceptance
6994
- * criteria: `.claude/state/docs-sync/<N>-audit.json`.
6988
+ * criteria: `.state/docs-sync/<N>-audit.json`.
6995
6989
  */
6996
- declare const DEFAULT_AUDIT_REPORT_DIR = ".claude/state/docs-sync";
6990
+ declare const DEFAULT_AUDIT_REPORT_DIR = ".state/docs-sync";
6997
6991
  /**
6998
6992
  * Stable iteration order for category keys. Matches the order they
6999
6993
  * appear in the persisted report and the order they ran during the
@@ -7093,7 +7087,7 @@ interface RunScanOptions {
7093
7087
  * {@link RunScanOptions.repoRoot}). Defaults to
7094
7088
  * {@link DEFAULT_AUDIT_REPORT_DIR}.
7095
7089
  *
7096
- * @default ".claude/state/docs-sync"
7090
+ * @default ".state/docs-sync"
7097
7091
  */
7098
7092
  readonly reportDir?: string;
7099
7093
  }
package/lib/index.js CHANGED
@@ -8340,7 +8340,7 @@ function buildDocsSyncSubAgent(_paths) {
8340
8340
  "persisted at:",
8341
8341
  "",
8342
8342
  "```",
8343
- ".claude/state/docs-sync/<issue-number>-audit.json",
8343
+ ".state/docs-sync/<issue-number>-audit.json",
8344
8344
  "```",
8345
8345
  "",
8346
8346
  "Every report carries a `schemaVersion`, the `issueNumber`, the",
@@ -11456,7 +11456,7 @@ function assertValidEligibleLabels(labels) {
11456
11456
 
11457
11457
  // src/agent/bundles/run-ratio.ts
11458
11458
  var DEFAULT_DISPATCH_TO_HOUSEKEEPING_RATIO = 4;
11459
- var DEFAULT_STATE_FILE_PATH = ".claude/state/orchestrator-runs.json";
11459
+ var DEFAULT_STATE_FILE_PATH = ".state/orchestrator-runs.json";
11460
11460
  var DEFAULT_DISPATCH_MODEL = "opus";
11461
11461
  var DEFAULT_HOUSEKEEPING_MODEL = "sonnet";
11462
11462
  function resolveRunRatio(config) {
@@ -12111,10 +12111,33 @@ function renderPipelineSkillBody(task, lines) {
12111
12111
  "filter issues by `type:*` or phase label. Each invocation runs the",
12112
12112
  `target sub-agent's full end-to-end cycle exactly once.`,
12113
12113
  "",
12114
- `Run \`.claude/agents/${task.agent}.md\` and follow its workflow`,
12115
- "from start to finish. The sub-agent is responsible for picking the",
12116
- "next unit of work, delegating implementation to other workers as",
12117
- "needed, and exiting cleanly.",
12114
+ "## Depth-0 execution contract",
12115
+ "",
12116
+ "**You \u2014 the scheduled-task session \u2014 are the pipeline manager.**",
12117
+ "Do **not** spawn the target sub-agent via the `Agent` tool. The",
12118
+ "Claude Code runtime forbids nested sub-agent spawning: a depth-1",
12119
+ "sub-agent cannot invoke `Agent` to reach depth-2, so a pipeline",
12120
+ "manager that delegates to other workers must run at depth-0 (this",
12121
+ "scheduled-task session). See",
12122
+ '<https://code.claude.com/docs/en/sub-agents> \u2014 *"Subagents cannot',
12123
+ "spawn other subagents. If your workflow requires nested delegation,",
12124
+ 'use Skills or chain subagents from the main conversation."*',
12125
+ "",
12126
+ "Therefore:",
12127
+ "",
12128
+ `1. **Read \`.claude/agents/${task.agent}.md\` in this session** and`,
12129
+ " execute its phase pipeline directly. Treat the agent file as a",
12130
+ " workflow runbook the scheduled-task session follows step-by-step,",
12131
+ " not as a sub-agent to spawn.",
12132
+ "2. **Use the `Agent` tool (with the `subagent_type` parameter set",
12133
+ " to the target worker name) to delegate one tier down.** From",
12134
+ " depth-0, you can spawn a depth-1 sub-agent (e.g. `issue-worker`,",
12135
+ " `pr-reviewer`) for the implementation, review, or merge step the",
12136
+ " pipeline calls out.",
12137
+ "3. **Never spawn the pipeline manager itself as a sub-agent.** Do",
12138
+ ` not call \`Agent(subagent_type: "${task.agent}", ...)\`. That`,
12139
+ " would put the pipeline manager at depth-1 and break every",
12140
+ " subsequent delegation step.",
12118
12141
  "",
12119
12142
  "## Recommended model",
12120
12143
  "",
@@ -13536,7 +13559,6 @@ var orchestratorSubAgent = {
13536
13559
  description: "End-to-end pipeline manager that runs one full cycle every invocation: pre-flight PR merge \u2192 triage \u2192 maintenance \u2192 queue scan \u2192 delegate the picked issue to the issue-worker \u2192 cleanup",
13537
13560
  model: AGENT_MODEL.POWERFUL,
13538
13561
  maxTurns: 100,
13539
- canDelegateToAgents: ["issue-worker", "pr-reviewer"],
13540
13562
  platforms: { cursor: { exclude: true } },
13541
13563
  prompt: [
13542
13564
  "# Orchestrator Agent",
@@ -13917,7 +13939,6 @@ var issueWorkerSubAgent = {
13917
13939
  description: "Selects the next ready issue from the queue, claims it, and implements the change end-to-end following repository conventions",
13918
13940
  model: AGENT_MODEL.POWERFUL,
13919
13941
  maxTurns: 100,
13920
- canDelegateToAgents: [],
13921
13942
  platforms: { cursor: { exclude: true } },
13922
13943
  prompt: [
13923
13944
  "# Issue Worker",
@@ -14346,7 +14367,13 @@ var ORCHESTRATOR_CONVENTIONS_PREAMBLE = [
14346
14367
  "- The queue scan reads only `priority:*` and `status:*` labels \u2014 type-routing (which typed agent handles a given `type:*` label) is the `issue-worker`'s concern, not the orchestrator's. The orchestrator's funnel-tier sort is a tie-breaker on `priority:*`, not a routing decision.",
14347
14368
  "- Priority order: critical > high > medium > low > trivial, then **funnel tier asc** (lower tier wins ties), then FIFO by issue number",
14348
14369
  "- Stale thresholds: 72h for in-progress, 168h for blocked",
14349
- "- Flagged issues get `status:needs-attention` \u2014 they are not auto-reset"
14370
+ "- Flagged issues get `status:needs-attention` \u2014 they are not auto-reset",
14371
+ "",
14372
+ "## Depth-0 invocation requirement",
14373
+ "",
14374
+ 'The orchestrator agent **must run as the top-level (depth-0) session** when its Phase G needs to delegate work to the `issue-worker` sub-agent. The Claude Code harness forbids nested sub-agent spawning \u2014 *"Subagents cannot spawn other subagents. If your workflow requires nested delegation, use Skills or chain subagents from the main conversation."* (see <https://code.claude.com/docs/en/sub-agents>). If the orchestrator itself were spawned as a depth-1 sub-agent (e.g. via `Agent(subagent_type: "orchestrator")` from another session), the `Agent` tool needed to reach the `issue-worker` at depth-2 would not be available and Phase G would silently abort.',
14375
+ "",
14376
+ 'Practical implication for scheduled-task wiring: the `worker-orchestrator` scheduled task\'s `SKILL.md` instructs the **scheduled-task session itself** to read `.claude/agents/orchestrator.md` and execute its phase pipeline in-session, then use the `Agent` tool to delegate the picked work item to `issue-worker` (depth-1). The scheduled task does **not** call `Agent(subagent_type: "orchestrator")` \u2014 that would put the orchestrator at depth-1 and break the chain.'
14350
14377
  ].join("\n");
14351
14378
  function buildOrchestratorConventionsContent(tiers, scopeGate = resolveScopeGate(), runRatio = resolveRunRatio(), preflight = resolvePreflightPr(), scheduledTasks = resolveScheduledTasks(), unblockDependents = resolveUnblockDependents()) {
14352
14379
  return [
@@ -27518,12 +27545,6 @@ var ClaudeRenderer = class _ClaudeRenderer {
27518
27545
  if (agent.platforms?.claude?.memory) {
27519
27546
  lines.push(`memory: ${agent.platforms.claude.memory}`);
27520
27547
  }
27521
- if (agent.canDelegateToAgents && agent.canDelegateToAgents.length > 0) {
27522
- lines.push(`canDelegateToAgents:`);
27523
- for (const delegateName of agent.canDelegateToAgents) {
27524
- lines.push(` - "${delegateName}"`);
27525
- }
27526
- }
27527
27548
  lines.push("---");
27528
27549
  lines.push("");
27529
27550
  lines.push(...agent.prompt.split("\n"));
@@ -30181,7 +30202,7 @@ function toPosix3(p) {
30181
30202
  // src/docs-sync/scan/run-scan.ts
30182
30203
  var fs3 = __toESM(require("fs"));
30183
30204
  var path6 = __toESM(require("path"));
30184
- var DEFAULT_AUDIT_REPORT_DIR = ".claude/state/docs-sync";
30205
+ var DEFAULT_AUDIT_REPORT_DIR = ".state/docs-sync";
30185
30206
  var SEVERITY_RANK = {
30186
30207
  blocking: 0,
30187
30208
  advisory: 1,