@wildorder/nightshift 0.12.0 → 0.13.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.
@@ -1,6 +1,6 @@
1
1
  import { access } from "node:fs/promises";
2
2
  import { homedir } from "node:os";
3
- import { join, resolve } from "node:path";
3
+ import { isAbsolute, join, resolve } from "node:path";
4
4
  const SPECS = [
5
5
  {
6
6
  target: "claude",
@@ -62,6 +62,38 @@ const SPECS = [
62
62
  { kind: "skill", scope: "user", root: join(configHome, "workspace", "skills") },
63
63
  ],
64
64
  },
65
+ {
66
+ target: "zed",
67
+ label: "Zed",
68
+ // Zed discovers skills from the same cross-tool .agents directory as
69
+ // Codex, not from its own config directory.
70
+ userSkills: (_configHome, home) => join(home, ".agents", "skills"),
71
+ projectSkills: join(".agents", "skills"),
72
+ // No extraScan: cursor's extraScan already watches .agents/skills at
73
+ // both scopes for shadowing definitions.
74
+ configDir: ({ home, env, platform }) => {
75
+ if (platform === "win32") {
76
+ const appData = env.APPDATA?.trim();
77
+ // No documented fallback path; a guess would silently install into
78
+ // a directory Zed never reads. Report "not detected" instead.
79
+ return appData ? join(appData, "Zed") : undefined;
80
+ }
81
+ if (platform === "darwin") {
82
+ // Zed's macOS build does not honor XDG_CONFIG_HOME — unlike its
83
+ // Linux build, this path is fixed.
84
+ return join(home, ".config", "zed");
85
+ }
86
+ // Linux (and other POSIX platforms): Zed reads $XDG_CONFIG_HOME/zed,
87
+ // falling back to ~/.config/zed. Honor XDG_CONFIG_HOME only when
88
+ // absolute — the XDG spec says a relative value is ignored, and
89
+ // resolving it against cwd would silently pick a directory Zed never
90
+ // reads.
91
+ const xdg = env.XDG_CONFIG_HOME?.trim();
92
+ return xdg && isAbsolute(xdg)
93
+ ? join(xdg, "zed")
94
+ : join(home, ".config", "zed");
95
+ },
96
+ },
65
97
  ];
66
98
  export const ALL_TARGETS = SPECS.map((spec) => spec.target);
67
99
  export const DEFAULT_TARGETS = ALL_TARGETS.join(",");
@@ -106,9 +138,21 @@ export function parseRootOverrides(entries) {
106
138
  }
107
139
  return overrides;
108
140
  }
109
- function configHomeFor(spec, home, env) {
141
+ /**
142
+ * The config home before any `homeEnv` relocation is applied — the one
143
+ * place the string-vs-function `configDir` branch lives, shared by both
144
+ * call sites that need it.
145
+ */
146
+ function baseConfigHome(spec, home, env, platform) {
147
+ return typeof spec.configDir === "function"
148
+ ? spec.configDir({ home, env, platform })
149
+ : join(home, spec.configDir);
150
+ }
151
+ function configHomeFor(spec, home, env, platform) {
110
152
  const override = spec.homeEnv ? env[spec.homeEnv]?.trim() : undefined;
111
- return override ? resolve(override) : join(home, spec.configDir);
153
+ return override
154
+ ? resolve(override)
155
+ : baseConfigHome(spec, home, env, platform);
112
156
  }
113
157
  /**
114
158
  * Resolve every target's roots and report which tools are actually present.
@@ -118,8 +162,9 @@ function configHomeFor(spec, home, env) {
118
162
  export async function detectTargets(context = {}) {
119
163
  const env = context.env ?? process.env;
120
164
  const home = resolve(context.home ?? homedir());
165
+ const platform = context.platform ?? process.platform;
121
166
  return Promise.all(SPECS.map(async (spec) => {
122
- const configHome = configHomeFor(spec, home, env);
167
+ const configHome = configHomeFor(spec, home, env, platform);
123
168
  const flag = context.roots?.[spec.target];
124
169
  const envOverride = env[overrideEnvName(spec.target)]?.trim();
125
170
  let userRoot;
@@ -133,10 +178,10 @@ export async function detectTargets(context = {}) {
133
178
  source = "env";
134
179
  }
135
180
  else {
136
- userRoot = spec.userSkills(configHome, home);
181
+ userRoot = spec.userSkills(configHome ?? "", home);
137
182
  // The tool's own home variable only counts as the source when it
138
183
  // actually moved the skills root; for Codex it moves detection only.
139
- const fromDefaultHome = spec.userSkills(join(home, spec.configDir), home);
184
+ const fromDefaultHome = spec.userSkills(baseConfigHome(spec, home, env, platform) ?? "", home);
140
185
  source = userRoot === fromDefaultHome ? "default" : "env";
141
186
  }
142
187
  return {
@@ -145,7 +190,7 @@ export async function detectTargets(context = {}) {
145
190
  userRoot,
146
191
  projectRoot: spec.projectSkills,
147
192
  configHome,
148
- detected: await pathExists(configHome),
193
+ detected: configHome !== undefined && (await pathExists(configHome)),
149
194
  source,
150
195
  };
151
196
  }));
@@ -168,11 +213,13 @@ export function scanRoots(detected, projectRoot, home) {
168
213
  scope: "project",
169
214
  root: join(projectRoot, entry.projectRoot),
170
215
  }, { target: spec.target, kind: "skill", scope: "user", root: entry.userRoot });
171
- for (const extra of spec.extraScan?.({
172
- home,
173
- projectRoot,
174
- configHome: entry.configHome,
175
- }) ?? []) {
216
+ for (const extra of entry.configHome !== undefined
217
+ ? (spec.extraScan?.({
218
+ home,
219
+ projectRoot,
220
+ configHome: entry.configHome,
221
+ }) ?? [])
222
+ : []) {
176
223
  roots.push({ target: spec.target, ...extra });
177
224
  }
178
225
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skill-roots.js","sourceRoot":"","sources":["../src/skill-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6C1C,MAAM,KAAK,GAAiB;IAC1B;QACE,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,mBAAmB;QAC5B,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;QACtD,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;QACxC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;YACpC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE;YACrF,EAAE,IAAI,EAAE,SAAS,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S;QACrB,KAAK,CAAC,IAAI,CACR;YACE,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;SAC3C,EACD,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAC5E,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;YAChD,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBAChB,IAAI;gBACJ,WAAW;gBACX,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC,IAAI,EAAE,CAAC;YACX,CAAC,CAAC,EAAE,EAAE,CAAC;YACP,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildorder/nightshift",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "The crew that builds while you're gone: walk-away, CI-dispatched engineering programs with a decision ledger instead of gates",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,20 @@ Read:
26
26
  present.
27
27
  - When re-planning after a run, the program's run report and decision ledger
28
28
  under `docs/programs/` — a prior run's parked workstreams, risk-accepted
29
- findings, and recorded decisions are planning input, not noise. Plan from
29
+ findings, recorded decisions, and **unmet human prerequisites** are
30
+ planning input, not noise. A prior run's workstreams left `awaiting_human`,
31
+ and the `prerequisites` entries still `pending` that they reference, name
32
+ work a human has not yet done. Preserve every prerequisite record that any
33
+ incomplete workstream still references — verbatim, with its stored
34
+ `status` unchanged, including a `satisfied` record a live workstream still
35
+ points at; do not drop it merely because it is satisfied, or the workstream
36
+ would reference an id the manifest no longer defines. Only a record whose
37
+ stored status is already `satisfied` may be treated as settled
38
+ infrastructure, and only because a prior run's preflight flipped it — never
39
+ because the planner judged the human's work done. A record still marked
40
+ `pending` stays `pending` even when the human reports having done the
41
+ action: the planner never flips a prerequisite's status; only the
42
+ deterministic preflight satisfies one, on the next run. Plan from
30
43
  the repository state that exists now, not from the original pre-program
31
44
  design; treat work a prior run verified and committed as current
32
45
  architecture rather than scheduling it again, and give replacement work new
@@ -143,6 +156,88 @@ npx --yes @wildorder/nightshift branch "{program-id}"
143
156
  This skill composes no git of its own — the command above owns branch
144
157
  selection, and the packaged runner owns every commit that follows.
145
158
 
159
+ ## 2.7. Run the actor audit
160
+
161
+ Before drafting either artifact, walk the phase's work and ask one question of
162
+ each unit: *what credential or access does this step consume, and does the
163
+ crew hold it?* This audit **discovers** human-only steps; it never blocks the
164
+ plan. A phase with no human-only actions produces an empty audit, and the
165
+ skill proceeds exactly as it does today — no `prerequisites` entries, no Human
166
+ Prerequisites section, no friction. There is no rule that a plan must declare
167
+ a prerequisite; there is only a question worth asking before the work is
168
+ scheduled.
169
+
170
+ The roster does not exist yet at this point — §3 and §4 haven't drafted it —
171
+ so audit a **provisional decomposition**: the candidate units of work the
172
+ phase breaks into, the same decomposition §3 and §4 will formalize into
173
+ workstreams. If drafting the final roster later **adds, removes, splits, or
174
+ moves a workstream**, re-check the hoist-and-batch assignment below against
175
+ the new roster, so every eventual unit of work has been audited and every
176
+ prerequisite lands on the workstream that actually consumes it.
177
+
178
+ **The enumerable tells** — the concrete signals a unit of work needs a human:
179
+
180
+ - cloud or organisation **admin credentials** the crew is not given;
181
+ - **console-only actions** with no API the agent can call;
182
+ - **trust anchors** — OIDC providers, state backends, signing keys — that a
183
+ human must establish before anything can authenticate against them;
184
+ - **secrets the agent may not set** (a repository or environment secret the
185
+ crew must never hold);
186
+ - **third-party account creation**;
187
+ - **DNS** records and delegations.
188
+
189
+ **A prerequisite is an action the crew *cannot* perform — never one that is
190
+ merely hard, slow, or annoying.** The audit's test is "does the crew hold
191
+ this?", never "is this unpleasant?" Work an agent can do, even tediously, is
192
+ not a prerequisite; declaring it as one manufactures an intermission and hands
193
+ the human work the run could have done itself.
194
+
195
+ **Convert each hit into a prerequisite** with:
196
+
197
+ - a stable **id**, conventionally `HP-01`, `HP-02`, …;
198
+ - a human-facing **description** of the action only a human can perform;
199
+ - a **remediation** written as the exact commands or console steps the human
200
+ runs — a runbook, not a hint (for example, a repository-settings change like
201
+ configuring branch protection in the hosting provider's settings, described
202
+ as console steps, not as a version-control command);
203
+ - a **verifyCommand**: a shell command that exits zero iff the action is done,
204
+ which the runner executes itself as a deterministic subprocess — never a
205
+ model's judgment. The observable must be one the headless runner can
206
+ actually query: non-interactive, reading no stdin, emitting no prompt, and
207
+ using only credentials the *runner* holds. This is the trap turned back on
208
+ itself — the prerequisite exists because the crew lacks a credential, and
209
+ the obvious way to verify the action often needs that same missing
210
+ privilege. Distinguish permission to **perform** the action (which the crew
211
+ lacks — that is why it is a prerequisite) from permission to **observe**
212
+ its completion (which the runner must have). If the only observable needs
213
+ the human-only privilege, pick a different observable the runner can reach
214
+ — a downstream effect, a read-only or verification-scoped credential
215
+ provisioned for the purpose — rather than shipping a command the runner
216
+ cannot execute. The `verifyCommand` is executed verbatim by the runner, the
217
+ same trust class as the verify commands in `nightshift.config.json` — it is
218
+ reviewed at planning time precisely because it will be run.
219
+
220
+ **Hoist and batch.** Human actions are expensive handoffs. Hoist each human
221
+ action to a workstream boundary rather than burying it mid-workstream, batch
222
+ independent human actions into the fewest handoffs (ideally one), and
223
+ sequence agent-doable work ahead of the first unmet prerequisite so a run
224
+ gets as far as it can before it must wait. A workstream that consumes a
225
+ prerequisite lists it in that workstream's `prerequisites`.
226
+
227
+ An empty audit is the normal outcome for a program that touches no
228
+ infrastructure — write no `prerequisites`, add no Human Prerequisites
229
+ section, and move on. But an infrastructure-touching program that emerges
230
+ from the audit with an empty prerequisites list is worth re-checking during
231
+ review: it usually means a human seam was missed, not that none exists. This
232
+ is guidance for a second look, not a rule the plan must pass.
233
+
234
+ **What this step does not do.** The audit produces manifest entries and
235
+ program-document prose. It never runs a `verifyCommand`, never verifies
236
+ whether a human has acted, and never changes a workstream's or a
237
+ prerequisite's `status` — that is the runner's job, at run time. It never
238
+ makes prerequisite declaration mandatory, never blocks a plan, and never adds
239
+ a step the plan must pass. An empty result is a complete, valid plan.
240
+
146
241
  ## 3. Draft the program document
147
242
 
148
243
  Inspect `docs/programs/` for an existing `*-program.md`. Match its structure
@@ -165,6 +260,13 @@ when one exists. Otherwise use:
165
260
  ## Architecture Changes
166
261
  [Changes from the system in as-built.md. For the first program, describe the full architecture.]
167
262
 
263
+ ## Human Prerequisites
264
+ [Only when the actor audit found human-only actions. One short paragraph or a
265
+ few bullets naming each prerequisite by id (HP-xx) and what it unblocks — which
266
+ workstreams wait on it and why the crew cannot perform it. Reference ids only;
267
+ the remediation, verifyCommand, and status live in the manifest, never here.
268
+ Omit this section entirely when the audit found no prerequisites.]
269
+
168
270
  ## Technology Choices
169
271
  [Only new choices. If none: "No new technology — uses existing stack."]
170
272
 
@@ -188,10 +290,13 @@ and never restates their text.
188
290
  The program document carries only what the manifest cannot: narrative
189
291
  architecture, causal reasoning, anticipated decisions, and risks. Success
190
292
  criteria, the workstream table, the dependency graph, and scope in/out lists
191
- are manifest data — do not reproduce them here. Two copies of the same fact
192
- drift apart; one canonical home per fact is a founding rule of this system.
193
- When this section's rule and an older program document's structure conflict,
194
- this rule wins: delete the duplicated sections rather than matching them.
293
+ are manifest data — do not reproduce them here. Human Prerequisites follows
294
+ the same rule: reference HP ids only, never their description, remediation,
295
+ verifyCommand, or status, all of which are manifest data. Two copies of the
296
+ same fact drift apart; one canonical home per fact is a founding rule of this
297
+ system. When this section's rule and an older program document's structure
298
+ conflict, this rule wins: delete the duplicated sections rather than matching
299
+ them.
195
300
 
196
301
  Write the draft directly to `docs/programs/{program-id}-program.md`. Do not
197
302
  paste the document into the conversation or ask for approval before saving —
@@ -217,6 +322,15 @@ exactly. Otherwise use:
217
322
  "successCriteria": [
218
323
  { "id": "SC-01", "description": "{verifiable outcome}" }
219
324
  ],
325
+ "prerequisites": [
326
+ {
327
+ "id": "HP-01",
328
+ "description": "{the action only a human can perform}",
329
+ "remediation": "{the exact commands or console steps the human runs}",
330
+ "verifyCommand": "{a shell command that exits zero iff the action is done}",
331
+ "status": "pending"
332
+ }
333
+ ],
220
334
  "packages": [
221
335
  {
222
336
  "name": "{package-name}",
@@ -237,6 +351,7 @@ exactly. Otherwise use:
237
351
  "excludes": ["{specific thing it deliberately does not cover}"]
238
352
  },
239
353
  "dependencies": [],
354
+ "prerequisites": [],
240
355
  "packages": []
241
356
  }
242
357
  ],
@@ -244,6 +359,11 @@ exactly. Otherwise use:
244
359
  }
245
360
  ```
246
361
 
362
+ The root `prerequisites` array and each workstream's `prerequisites` id list
363
+ come from the actor audit (§2.7). Omit the root array, or leave it empty, when
364
+ the audit found nothing — the schema defaults it to `[]`, so a
365
+ prerequisite-free manifest is byte-for-byte what the skill emits today.
366
+
247
367
  Save it directly to `docs/programs/{program-id}-manifest.json`.
248
368
  Keep the manifest, program document, and every referenced `taskFile`
249
369
  trackable by Git — nightshift tags decisions to commits and replays roll back