rvlib-shipkit 2.33.0 → 2.35.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +7 -0
  3. package/package.json +1 -1
  4. package/src/advisors/advisor-view.ts +1 -0
  5. package/src/advisors/sync.ts +4 -1
  6. package/src/agent-time/accounts-usage.ts +5 -0
  7. package/src/agent-time/render.ts +4 -2
  8. package/src/cli/cmd_BackupTargets.ts +49 -8
  9. package/src/cli/cmd_Commands.ts +3 -2
  10. package/src/cli/cmd_Init.ts +1 -1
  11. package/src/cli/cmd_Media.ts +1 -1
  12. package/src/cli/cmd_Orchestrator.ts +3 -3
  13. package/src/cli/cmd_Setup.ts +11 -2
  14. package/src/cli/cmd_Shot.ts +2 -2
  15. package/src/cli/cmd_Start.ts +6 -6
  16. package/src/cli/cmd_Time.ts +4 -2
  17. package/src/cli/family-pages.ts +11 -1
  18. package/src/cli/house-pages.ts +34 -0
  19. package/src/core/memory-watch.ts +1 -1
  20. package/src/gate/gate-checks.ts +7 -5
  21. package/src/home/backup-status.ts +54 -13
  22. package/src/home/backup-verdict.ts +1 -0
  23. package/src/home/configuration-route.ts +281 -0
  24. package/src/home/configuration-shape.ts +167 -0
  25. package/src/home/daemon-jobs.ts +5 -0
  26. package/src/home/home-routes.ts +9 -2
  27. package/src/home/house-bucket.ts +14 -0
  28. package/src/home/serve-web.ts +1 -1
  29. package/src/home/this-house.ts +68 -0
  30. package/src/home/via-hub.ts +2 -1
  31. package/src/hq/backup-targets.ts +58 -5
  32. package/src/hq/hq-local.ts +1 -1
  33. package/src/http/owner-word.ts +1 -0
  34. package/src/media-store/backup/bucket-target.ts +58 -0
  35. package/src/media-store/backup/target-send.ts +7 -4
  36. package/src/media-store/space.ts +2 -0
  37. package/src/review/cells.ts +6 -2
  38. package/src/review/store.ts +2 -1
  39. package/src/scaffold/project-scaffold.ts +2 -2
  40. package/src/scaffold/starter-house.ts +8 -6
  41. package/src/secrets/read.ts +1 -1
  42. package/src/serve/hub-app/auto-text.tsx +3 -1
  43. package/src/serve/hub-app/backups-view.tsx +4 -2
  44. package/src/serve/hub-app/columns.ts +5 -0
  45. package/src/serve/hub-app/configuration-st.ts +102 -0
  46. package/src/serve/hub-app/configuration-view.tsx +145 -0
  47. package/src/serve/hub-app/configuration.css +27 -0
  48. package/src/serve/hub-app/configure-link.tsx +16 -0
  49. package/src/serve/hub-app/database-view.tsx +3 -3
  50. package/src/serve/hub-app/home-pages.ts +2 -0
  51. package/src/serve/hub-app/home-st.ts +15 -4
  52. package/src/serve/hub-app/home.html +1 -0
  53. package/src/serve/hub-app/hub-app.tsx +2 -0
  54. package/src/serve/hub-app/icons.tsx +2 -0
  55. package/src/serve/hub-app/identities-view.tsx +2 -1
  56. package/src/serve/hub-app/index.html +1 -0
  57. package/src/serve/hub-app/machines-view.tsx +2 -0
  58. package/src/serve/hub-app/place-path.ts +1 -1
  59. package/src/serve/hub-app/projects-svc.ts +2 -1
  60. package/src/serve/hub-app/review/review-thread.tsx +2 -1
  61. package/src/serve/hub-app/review/thread-st.ts +8 -2
  62. package/src/serve/hub-app/review/tone-bar.tsx +4 -2
  63. package/src/serve/hub-app/secrets-page.tsx +2 -0
  64. package/src/serve/hub-app/space-view.tsx +2 -0
  65. package/src/serve/hub-app/vault-view.tsx +2 -0
  66. package/src/setup-house.ts +9 -9
  67. package/src/start-repo.ts +27 -30
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## 2.35.0
2
+
3
+ ### Added
4
+
5
+ - **The configuration page** (`/configuration` in the hub): everything you can set on this machine, one topic each (backups, secrets, Claude accounts, GitHub, the house, identities, machines, media, the vault, remote, notifications), where each stands and what sets it. Backup targets (a bucket, a machine over ssh, on and off, a try) and secrets are set from it; every act is a click behind the owner's word, a stored secret is replaced only when « replace » is ticked, and a target's address never changes from the page. « Configure » links lead there from the pages these topics show on.
6
+ - **A new house gets the shipkit manual**: `sk setup` writes the two generated pages (`sk commands --everyday`, `sk thread kinds`), and the README says what « wiki <path> » in a help text means.
7
+
8
+ ### Changed
9
+
10
+ - **A first backup target has 30 minutes** before a missing copy rings; a house with no media bucket is no longer judged on a Space it does not have.
11
+ - **`sk start`'s CLAUDE.md lines name no `~/dev`**, and the help names no account launcher of one house.
12
+
13
+ Nothing of a newcomer's first run was proven from zero in a container. `sk start` still makes a private GitHub repo and pushes when `gh` is logged in.
14
+
15
+ ## 2.34.0
16
+
17
+ ### Added
18
+
19
+ - **A backup target can be any S3 bucket**: `sk backup targets add <id> --endpoint <origin> --bucket <name> --key-id <secret> --key-secret <secret>` (MinIO, R2, any server; the row names the two secrets of its key, never a value), `check` writes one object and reads it back, `get` writes the newest copy of a store back to a folder, checked against its sha.
20
+ - **An advisor's ok that waits for the owner lights their answer bar**: a click on it adds a note to it, never a second ok.
21
+
22
+ ### Changed
23
+
24
+ - **`sk start` writes this machine's own house** as line 1 of a new repo's CLAUDE.md (the house its pm runs from, else the one `sk setup` made beside the repos), and puts the repo beside it. The package names no house of its own. A house `sk setup` made writes no `.claude/` policy files.
25
+ - **A machine with no backup set up yet says so in one orange line**: no red band, no notification, no vault row where no vault runs.
26
+ - **Seeded backup targets are named by their provider** (`do-space`, `cf-r2`), else `space` and `space-copy`.
27
+ - **The daemon's steady memory budget is 750 MB** (was 500 MB); its boot budget stays 1 GB.
28
+
29
+ ### Fixed
30
+
31
+ - **`SHIPKIT_TEST_SELECT=1 sk ci` selects suites** when the daemon runs the gate: the switch now reaches the job.
32
+ - **The thread store compiles under an ES2022 lib**: four native `findLast` calls use the package's own helper, so a repo whose tsconfig stops at ES2022 types against shipkit again.
33
+ - **No owner facts in the help texts**: an ask number, secret names and a machine's name left three help lines.
34
+
35
+ Nothing of a newcomer's first run was proven from zero in a container: no container runtime ran.
36
+
1
37
  ## 2.33.0
2
38
 
3
39
  ### Added
package/README.md CHANGED
@@ -15,6 +15,13 @@ sk gui # the hub: threads, asks, checks
15
15
 
16
16
  `sk setup` makes your house, `<you>-shipkit-setup`, in the same folder as the repo: a starter wiki that every wired repo loads first, and an empty identities folder. Its plan names every file it writes or changes: it writes nothing through a link and never overwrites a file of yours, but `sk init` reshapes package.json scripts (your `test` moves to `test:raw`) and points git's hooks at `.shipkit/hooks`. It makes one network call, `bun add -d rvlib-shipkit` in the repo. After it, shipkit runs a background service on the Mac for the hub (a LaunchAgent, `com.shipkit.pm`): `sk pm uninstall` stops it.
17
17
 
18
+ A help text or a message may end with `wiki <path>` (`wiki tools/shipkit/threads.md`), or with `Read first: wiki <path>`. It names a page of the author's manual, which is not shipped yet: `sk <command> --help` is what you have, and the two pages `sk setup` writes into your house, `wiki/shipkit/commands.md` (every command) and `wiki/shipkit/thread-kinds.md` (what shows up in a thread). After an upgrade, run in the house:
19
+
20
+ ```sh
21
+ sk commands --everyday --out wiki/shipkit/commands.md
22
+ sk thread kinds --out wiki/shipkit/thread-kinds.md
23
+ ```
24
+
18
25
  Into a repo by hand, with no house:
19
26
 
20
27
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rvlib-shipkit",
3
- "version": "2.33.0",
3
+ "version": "2.35.0",
4
4
  "funding": "https://github.com/sponsors/rvion",
5
5
  "description": "All-in-one repo companion: ci gate (task DAG), auto-discovered health checks, release-contract fulfillness, asks queue, md-wiki tools, asset atelier, live tui",
6
6
  "license": "MIT",
@@ -232,6 +232,7 @@ const REPLY: Rules<ReplyCell> = {
232
232
  instructions: 'drop',
233
233
  step: 'drop',
234
234
  linked: 'drop',
235
+ advice: table({ status: 'token', on: 'id' }),
235
236
  }
236
237
  const NOTE: Rules<NoteCell> = { ...BASE, item: table(ITEM), text: 'text', rects: always([]), image: 'file', files: REPLY.files, rate: 'drop', read: 'bool' }
237
238
  const EVENT: Rules<EventCell> = { ...BASE, op: 'token', note: 'drop', topic: 'drop', commit: 'drop', trace: table(TRACE) }
@@ -125,7 +125,10 @@ function pendingCells(s: OwnerState, x: Share, thread: Thread, view: AdvisorThre
125
125
  .map((a) => {
126
126
  const what = a.kind === 'pick' ? `I pick option ${(a.option ?? 0) + 1}` : (ADVICE_WORDS[a.kind] ?? '')
127
127
  const text = [what, namedFiles(a.text ?? '', a.files ?? [])].filter((w) => w !== '').join(': ')
128
- return { kind: 'reply' as const, id: adviceCell(view.head, a.id), on: view.head, at: a.at, who: ADVISOR_WHO, party: 'owner' as const, summary: text, open: true, text: a.state === 'pending' ? `${text}\n\nwaits for ${owner}` : text, read: true } satisfies ReplyCell
128
+ // their ok or fix that waits: their bar on that version draws it lit, so a second click adds a note, never a second ok
129
+ const tone: NonNullable<ReplyCell['advice']>['status'] | null = a.kind === 'approve' ? 'approved' : a.kind === 'change' ? 'approved-with-fix' : null
130
+ const advice = a.state === 'pending' && tone !== null && a.item !== undefined ? { advice: { status: tone, on: opaqueItem(x.id, a.item) } } : {}
131
+ return { kind: 'reply' as const, id: adviceCell(view.head, a.id), on: view.head, at: a.at, who: ADVISOR_WHO, party: 'owner' as const, summary: text, open: true, text: a.state === 'pending' ? `${text}\n\nwaits for ${owner}` : text, read: true, ...advice } satisfies ReplyCell
129
132
  })
130
133
  }
131
134
 
@@ -23,6 +23,11 @@ function windowOf(v: unknown): UsageWindow | null {
23
23
  return { used, resetsAt: at == null ? null : at * 1000 }
24
24
  }
25
25
 
26
+ /** a config folder's account: the name the main panel shows where a status line or a launcher reported that folder,
27
+ * else the folder's own name, `default` for the plain one */
28
+ export const accountLabel = (folder: string, accounts: readonly { name: string; dir: string | null }[]): string =>
29
+ accounts.find((a) => a.dir != null && (a.dir.split('/').at(-1) ?? '') === folder)?.name ?? (folder === '.claude' ? 'default' : folder.replace(/^\.claude-/, '').replace(/^\./, ''))
30
+
26
31
  /** c3 → cc3, the account's usual name; any other tag stays as it is */
27
32
  export const accountName = (tag: string): string => (/^c\d+$/.test(tag) ? `c${tag}` : tag)
28
33
 
@@ -30,7 +30,7 @@ const day = (t: number): string => dayStamp(t)
30
30
  const when = (t: number): string => stampOf(new Date(t)).slice(5, 16)
31
31
  const pct = (part: number, whole: number): string => (whole <= 0 ? '0%' : `${Math.round((100 * part) / whole)}%`)
32
32
  const n = (x: number): string => x.toLocaleString('en-US')
33
- const account = (a: string): string => (a === '.claude' ? 'cc1' : a.replace(/^\.claude-/, ''))
33
+ const accountOf = (plain: string) => (a: string): string => (a === '.claude' ? plain : a.replace(/^\.claude-/, ''))
34
34
 
35
35
  function table(head: string[], rows: string[][]): string[] {
36
36
  const all = [head, ...rows]
@@ -211,7 +211,9 @@ function complaint(h: TimeReport['feedback']['hits'][number]): string {
211
211
  return ` ${when(h.at)} ${h.signals.map((s) => s.rule).join(',')} "${h.text.slice(0, 70)}" ← ${ran}`
212
212
  }
213
213
 
214
- export function render(r: TimeReport, view: View, top: number): string {
214
+ /** `plain`: the name of the account of ~/.claude on this machine */
215
+ export function render(r: TimeReport, view: View, top: number, plain = 'default'): string {
216
+ const account = accountOf(plain)
215
217
  let out: string[]
216
218
  switch (view) {
217
219
  case 'summary':
@@ -51,7 +51,7 @@ export class BackupStatusCommand extends Command {
51
51
  }
52
52
  }
53
53
 
54
- const TARGETS_DETAILS = `the places the house's backups go, one row each in the hq: an s3 bucket the house config owns (serve.mediaSpace, the Space; serve.spaceCopy, its second place) or a machine of the tailnet over ssh (its host and a folder under its home). No row holds a secret: a bucket's key stays in the vault under the names the config gives. The first list fills an empty table with the Space, the second place and the thread copy's peer. Every store goes to every target that is on (sk backup status says how each one stands); rm removes the row only, never what the target holds. Page: wiki tools/shipkit/media-store-backup.md, Targets`
54
+ const TARGETS_DETAILS = `the places the house's backups go, one row each in the hq: a bucket of any S3 server (its origin, its bucket, the names of the two secrets of its key), an s3 bucket the house config owns (serve.mediaSpace, the Space; serve.spaceCopy, its second place) or a machine over ssh (its host and a folder under its home). No row holds a secret: a key is two secrets, stored first (sk secret set), named by the row. The first list fills an empty table with the buckets the config names. check writes one small object and reads it back; get writes the newest copy of a store back into a folder, its bytes compared with the sha they went up with. Every store goes to every target that is on (sk backup status says how each one stands); rm removes the row only, never what the target holds. Page: wiki tools/shipkit/media-store-backup.md, Targets`
55
55
 
56
56
  type Answer = { targets?: import('../hq/backup-targets.ts').BackupTarget[]; refused?: string; removed?: boolean } & Partial<import('../hq/backup-targets.ts').BackupTarget>
57
57
 
@@ -60,16 +60,25 @@ async function admin(path: string, body: unknown = {}): Promise<Answer> {
60
60
  return askHqAdmin<Answer>(path, body)
61
61
  }
62
62
 
63
- const where = (t: import('../hq/backup-targets.ts').BackupTarget): string => (t.address.kind === 'ssh' ? `ssh ${t.address.host}:${t.address.folder}` : `s3, the bucket of serve.${t.address.config}`)
63
+ const where = (t: import('../hq/backup-targets.ts').BackupTarget): string => (t.address.kind === 'ssh' ? `ssh ${t.address.host}:${t.address.folder}` : 'config' in t.address ? `s3, the bucket of serve.${t.address.config}` : `s3, ${t.address.bucket} at ${t.address.endpoint}`)
64
64
 
65
65
  export class BackupTargetsCommand extends Command {
66
66
  static override paths = [['backup', 'targets']]
67
- static override usage = Command.Usage({ category: 'Media', description: 'the places the backups go, stored in the hq: buckets and machines over ssh', details: TARGETS_DETAILS, examples: [['the list', 'sk backup targets'], ['a machine', 'sk backup targets add nas --ssh nas --folder ~/backups --label "the NAS"'], ['switch one off', 'sk backup targets off nas']] })
68
- verb = Option.String({ required: false, name: 'ls | add | on | off | rm' })
67
+ static override usage = Command.Usage({ category: 'Media', description: 'the places the backups go, stored in the hq: buckets and machines over ssh', details: TARGETS_DETAILS, examples: [['the list', 'sk backup targets'], ['a bucket', 'sk backup targets add mine --endpoint https://s3.example.com --bucket my-backups --region us-east-1 --key-id backup/id --key-secret backup/secret'], ['does it take and give back an object', 'sk backup targets check mine'], ['the newest copy of the hq, back on the disk', 'sk backup targets get mine --to ~/restored'], ['a machine', 'sk backup targets add nas --ssh nas --folder ~/backups --label "the NAS"'], ['switch one off', 'sk backup targets off nas']] })
68
+ verb = Option.String({ required: false, name: 'ls | add | check | get | on | off | rm' })
69
69
  id = Option.String({ required: false, name: 'id' })
70
- ssh = Option.String('--ssh', { description: 'add: the ssh host of the tailnet' })
70
+ ssh = Option.String('--ssh', { description: 'add: the ssh host' })
71
71
  folder = Option.String('--folder', { description: 'add: the folder under its home, ~/a/b' })
72
72
  s3 = Option.String('--s3', { description: 'add: mediaSpace or spaceCopy, the config key that owns the bucket' })
73
+ endpoint = Option.String('--endpoint', { description: 'add: the origin of an S3 server, https://s3.example.com' })
74
+ bucket = Option.String('--bucket', { description: 'add: its bucket' })
75
+ region = Option.String('--region', { description: 'add: its region (auto when absent)' })
76
+ hostStyle = Option.Boolean('--bucket-in-host', false, { description: 'add: the bucket is in the endpoint\'s host already; absent, it goes in the path, which MinIO and R2 want' })
77
+ keyId = Option.String('--key-id', { description: 'add: the secret that holds the access key id' })
78
+ keySecret = Option.String('--key-secret', { description: 'add: the secret that holds the secret access key' })
79
+ store = Option.String('--store', 'hq', { description: 'get: hq or vault' })
80
+ to = Option.String('--to', { description: 'get: the folder the copy lands in' })
81
+ machine = Option.String('--machine', { description: "get: another machine's copies, by its name; this one's when absent" })
73
82
  label = Option.String('--label', { description: 'add: the name the status shows' })
74
83
  async execute(): Promise<number> {
75
84
  const err = (l: string): number => (this.context.stderr.write(`FAIL: backup targets: ${l}\n`), 1)
@@ -93,14 +102,46 @@ export class BackupTargetsCommand extends Command {
93
102
  this.context.stdout.write(r.removed ? `ok: ${this.id} is no longer a target; what it holds stays there\n` : `ok: no target ${this.id}\n`)
94
103
  return 0
95
104
  }
105
+ if (verb === 'check' || verb === 'get') {
106
+ const list = await admin('/api/home/hq/targets')
107
+ if (list.refused != null) return err(list.refused)
108
+ const { ownBucket } = await import('../hq/backup-targets.ts')
109
+ const t = (list.targets ?? []).find((x) => x.id === this.id)
110
+ const own = t == null ? null : ownBucket(t.address)
111
+ if (t == null) return err(`no target ${this.id} (sk backup targets)`)
112
+ if (own == null) return err(`${this.id} is no bucket added by hand: sk backup status says how it stands`)
113
+ const [{ bucketProblem, getNewest }, { houseBucket }] = await Promise.all([import('../media-store/backup/bucket-target.ts'), import('../home/house-bucket.ts')])
114
+ const c = await houseBucket(own)
115
+ if ('why' in c) return err(c.why)
116
+ const { machineName } = await import('../home/machine-host.ts')
117
+ const machine = this.machine ?? machineName()
118
+ if (verb === 'check') {
119
+ const why = await bucketProblem(c, machine)
120
+ if (why != null) return err(`${t.label}: ${why}`)
121
+ this.context.stdout.write(`ok: ${t.label} took one object and gave the same bytes back\n`)
122
+ return 0
123
+ }
124
+ if (this.to == null) return err(`get takes --to <folder>`)
125
+ if (this.store !== 'hq' && this.store !== 'vault') return err('--store: hq or vault')
126
+ const { resolve } = await import('node:path')
127
+ try {
128
+ const r = await getNewest(c, { store: this.store, machine, to: resolve(this.to) })
129
+ this.context.stdout.write(`ok: ${r.file}, ${r.bytes} bytes, from ${r.key}, its sha the one it went up with\n`)
130
+ return 0
131
+ } catch (e) {
132
+ return err((e as Error).message)
133
+ }
134
+ }
96
135
  if (verb === 'add') {
97
- const address = this.ssh != null ? { kind: 'ssh', host: this.ssh, folder: this.folder ?? '~/.shipkit' } : this.s3 != null ? { kind: 's3', config: this.s3 } : null
98
- if (address == null) return err('add takes --ssh <host> [--folder ~/dir] or --s3 mediaSpace|spaceCopy')
136
+ if (this.endpoint != null && (this.bucket == null || this.keyId == null || this.keySecret == null)) return err('add --endpoint takes --bucket, --key-id and --key-secret: the last two name the secrets of its key (sk secret set <name> stores one)')
137
+ const bucket = this.endpoint == null ? null : { kind: 's3', endpoint: this.endpoint.replace(/\/$/, ''), bucket: this.bucket, region: this.region ?? 'auto', ...(this.hostStyle ? {} : { path: true }), key: { accessKeyId: this.keyId, secretAccessKey: this.keySecret } }
138
+ const address = bucket != null ? bucket : this.ssh != null ? { kind: 'ssh', host: this.ssh, folder: this.folder ?? '~/.shipkit' } : this.s3 != null ? { kind: 's3', config: this.s3 } : null
139
+ if (address == null) return err('add takes --endpoint <origin> --bucket <name> --key-id <secret> --key-secret <secret>, --ssh <host> [--folder ~/dir], or --s3 mediaSpace|spaceCopy')
99
140
  const r = await admin('/api/home/hq/targets/put', { id: this.id, label: this.label ?? this.id, address })
100
141
  if (r.refused != null) return err(r.refused)
101
142
  this.context.stdout.write(`ok: ${this.id} added (${r.address == null ? '' : where(r as import('../hq/backup-targets.ts').BackupTarget)}); the next look of the daemon sends to it\n`)
102
143
  return 0
103
144
  }
104
- return err(`${verb}: ls, add, on, off or rm`)
145
+ return err(`${verb}: ls, add, check, get, on, off or rm`)
105
146
  }
106
147
  }
@@ -5,7 +5,7 @@
5
5
  // (the kit in cli/kit/) come out of these functions.
6
6
  import { Command, Option } from './clip.ts'
7
7
  import { spliceMarkedBlock } from '../core/doc-block.ts'
8
- import { FAMILY_PAGES } from './family-pages.ts'
8
+ import { FAMILY_PAGES, pagesIn } from './family-pages.ts'
9
9
  import { type Effect, type Essential, type Film, marksOf, ROW_OF, runText } from './kit/verb.ts'
10
10
 
11
11
  export type CommandOption = { definition: string; description: string }
@@ -381,7 +381,8 @@ export class CommandsCommand extends Command {
381
381
  const write = (s: string): void => void this.context.stdout.write(s)
382
382
  const pages = (this.constructor as typeof CommandsCommand).familyPages
383
383
  // --everyday is a compact form: it never falls back to the full markdown
384
- const render = (): string => (this.everyday ? renderEveryday(rows, bin, pages) : this.compact ? renderCompact(rows, bin, pages) : renderMarkdown(rows, bin))
384
+ const shownPages = pages == null || this.out == null ? pages : pagesIn(this.out, pages)
385
+ const render = (): string => (this.everyday ? renderEveryday(rows, bin, shownPages) : this.compact ? renderCompact(rows, bin, shownPages) : renderMarkdown(rows, bin))
385
386
  if (this.check && this.out == null && this.essentials == null) {
386
387
  write(`FAIL: --check compares a page with the binary: name the page with --out <file> or --essentials <file>\n`)
387
388
  return 2
@@ -9,7 +9,7 @@ export class InitCommand extends Command {
9
9
  static override usage = Command.Usage({
10
10
  category: 'Setup',
11
11
  description: 'wire this dir as a shipkit repo, like git init: a private github repo and a push unless --no-github',
12
- details: 'wire THE CURRENT DIRECTORY as a shipkit repo, like git init: cwd only, never creates a project dir. scaffolds repo.config.ts + ci/check/contracts package.json scripts + the create-only .vscode/ that starts the watchers and the hub on folder open, prints how the floor resolved, and runs the bootstrap chain around it: git init, then first commit + PRIVATE github repo + push once the scaffold is in. Idempotent on an already-wired repo. To create or adopt ~/dev/<name> from anywhere: `shipkit start <name>`',
12
+ details: 'wire THE CURRENT DIRECTORY as a shipkit repo, like git init: cwd only, never creates a project dir. scaffolds repo.config.ts + ci/check/contracts package.json scripts + the create-only .vscode/ that starts the watchers and the hub on folder open, prints how the floor resolved, and runs the bootstrap chain around it: git init, then first commit + PRIVATE github repo + push once the scaffold is in. Idempotent on an already-wired repo. To create or adopt a repo beside your house from anywhere: `shipkit start <name>`',
13
13
  examples: [
14
14
  ['wire the repo you are standing in', 'sk init'],
15
15
  ['local git and the first commit, never touch github', 'sk init --no-github'],
@@ -260,7 +260,7 @@ export class MediaVersioningCommand extends Command {
260
260
  details: `PutBucketVersioning, then GetBucketVersioning to confirm: an object deleted or overwritten from the DigitalOcean dashboard or by a stray key keeps its older version. DigitalOcean offers it through the S3 API only. Once on, it can only be suspended, never turned off. The house key is limited to the bucket's objects and cannot change it: --key names a full access key pair kept once in the keychain for this call. Page: wiki tools/shipkit/media-store.md, Versioning`,
261
261
  examples: [
262
262
  ['turn it on', 'sk media versioning'],
263
- ['turn it on with a one time full access key', 'sk media versioning --key-id rv/shipkit/spaces-admin-access-key-id --key-secret rv/shipkit/spaces-admin-secret-access-key'],
263
+ ['turn it on with a one time full access key', 'sk media versioning --key-id demo/spaces-admin-id --key-secret demo/spaces-admin-secret'],
264
264
  ['read it', 'sk media versioning --check'],
265
265
  ],
266
266
  })
@@ -86,11 +86,11 @@ export class OrchestratorOnCommand extends Command {
86
86
  static override usage = Command.Usage({
87
87
  category: 'Review',
88
88
  description: "start a Claude Code session in a project's CLAUDE section, under the account named",
89
- details: `A fresh session, through the account's own launcher (cc3), on --model (opus by default), with the brief of a default session and its deny rules; its first prompt runs sk session default. --account is required when this Mac has more than one Claude account; an account at its usage limit is refused. Nothing starts it again when it ends. In the hub, + in the CLAUDE section starts a plain session. ${PAGE}`,
90
- examples: [['this repo, as cc2', 'sk session start --account cc2'], ['another repo', 'sk session start my-game --account 3']],
89
+ details: `A fresh session, through the account's own launcher where the shell has one, on --model (opus by default), with the brief of a default session and its deny rules; its first prompt runs sk session default. --account is required when this Mac has more than one Claude account; an account at its usage limit is refused. Nothing starts it again when it ends. In the hub, + in the CLAUDE section starts a plain session. ${PAGE}`,
90
+ examples: [['this repo, as the account work', 'sk session start --account work'], ['another repo', 'sk session start my-game --account work']],
91
91
  })
92
92
  repo = Option.String({ required: false })
93
- account = Option.String('--account', { description: 'the Claude account: cc2, c2 or 2' })
93
+ account = Option.String('--account', { description: 'the Claude account, by the name the hub shows (a numbered one by its number too)' })
94
94
  model = Option.String('--model', { description: 'the model it runs on (opus)' })
95
95
  async execute(): Promise<number> {
96
96
  const repo = await repoHere(this.repo)
@@ -1,6 +1,15 @@
1
1
  // shipkit setup: a new user's first house and one repo wired to it. Thin clipanion surface; logic in setup-house.ts,
2
2
  // imported when it runs.
3
3
  import { Command, Option } from './clip.ts'
4
+ import type { Definition } from './cmd_Commands.ts'
5
+
6
+ /** the two pages of a new house, from the whole registry of this binary */
7
+ export async function generatedPages(): Promise<Record<string, string>> {
8
+ const [{ buildCli }, { commandRows, renderEveryday }, { renderCatalog }, { housePages }] = await Promise.all([import('./registry.ts'), import('./cmd_Commands.ts'), import('../review/kind-catalog.ts'), import('./house-pages.ts')])
9
+ const cli = await buildCli()
10
+ const rows = commandRows(cli.definitions() as Definition[], (cli.definitions as (o?: { detailed?: boolean }) => Definition[])({ detailed: true }), 'sk', cli.classes)
11
+ return housePages({ commands: renderEveryday(rows), kinds: renderCatalog() })
12
+ }
4
13
 
5
14
  export class SetupCommand extends Command {
6
15
  static override paths = [['setup']]
@@ -9,7 +18,7 @@ export class SetupCommand extends Command {
9
18
  static override usage = Command.Usage({
10
19
  category: 'Setup',
11
20
  description: 'your own house beside this repo, and the repo wired to it: a dry run until --yes',
12
- details: 'The first command after `bun add -g rvlib-shipkit`. It makes your house, `<you>-shipkit-setup` beside the repo: a starter wiki every wired repo loads first, an empty identities folder, a local git repo. Then it wires this repo: shipkit installed in it (`bun add -d`, the one network call), `sk init` with GitHub off, CLAUDE.md line 1 loading the house, and imports:check off when the repo does not follow its style. Before anything it refuses on a machine that already runs a house, on a repo with no package.json, and on a house folder that is not its own. It prints every path it would write, and writes nothing without --yes. A file that exists and differs is kept and listed. A second run says « nothing to do ». macOS only.',
21
+ details: 'The first command after `bun add -g rvlib-shipkit`. It makes your house, `<you>-shipkit-setup` beside the repo: a starter wiki every wired repo loads first (with every command and every thread kind, two pages shipkit generates), an empty identities folder, a local git repo. Then it wires this repo: shipkit installed in it (`bun add -d`, the one network call), `sk init` with GitHub off, CLAUDE.md line 1 loading the house, and imports:check off when the repo does not follow its style. Before anything it refuses on a machine that already runs a house, on a repo with no package.json, and on a house folder that is not its own. It prints every path it would write, and writes nothing without --yes. A file that exists and differs is kept and listed. A second run says « nothing to do ». macOS only.',
13
22
  examples: [
14
23
  ['see the plan, write nothing', 'sk setup'],
15
24
  ['write it', 'sk setup --yes'],
@@ -25,6 +34,6 @@ export class SetupCommand extends Command {
25
34
 
26
35
  async execute(): Promise<number> {
27
36
  const { setupHouse } = await import('../setup-house.ts')
28
- return setupHouse({ yes: this.yes, repo: this.repo, house: this.house, home: this.home, lib: this.lib, print: (l) => this.context.stdout.write(`${l}\n`) })
37
+ return setupHouse({ yes: this.yes, repo: this.repo, house: this.house, home: this.home, lib: this.lib, generated: generatedPages, print: (l) => this.context.stdout.write(`${l}\n`) })
29
38
  }
30
39
  }
@@ -48,7 +48,7 @@ export class ShotCommand extends Command {
48
48
  category: 'Serve',
49
49
  description: 'a webp of any url through the warm browser (a png with --out x.png), or an mp4 clip with --video',
50
50
  details:
51
- 'one warm headless chromium for the whole machine (the `shot` global process, started when down). A still reuses the warm page when it already shows the url, so a warm shot answers in about 0.1 s. A page with `<meta name="shot-ready" content="wait">` is shot once it sets content="ready"; any other page --wait ms after its load; a page that navigates while it loads (a sign in that redirects) gets its wait again where it lands. --full shoots the whole page at the width of the viewport: one file while the page fits the tallest side of its format (webp 16383 px, jpg and png 65535), else tiles in that format, <name>-1, <name>-2… top to bottom, every one printed, so nothing of the page is lost and the format stays the one asked (a jpg instead of a webp would change what the caller asked for, a cut would drop the end of the page); a whole page stops at 131072 px, the cut said in the note. A file of this machine is a url too (its path, or file://). --video films a page that is a canvas through its WebCodecs encoder (H.264 muxed with no second encode), and any other page as chromium paints it (its screencast, encoded by ffmpeg as the frames arrive); --dom films the page even when a canvas fills it. --step <hook> films frame by frame: before each frame the page draws its time t (seconds) in `await window[hook](t)`, then its ready mark, so a slow page films smooth at its fps; a canvas page is encoded by its own WebCodecs at the exact time n / fps, any other page a screenshot a frame. A still with --step is the page drawn at --at s. A session: cookies follow every shot (one jar in memory for the whole machine), the local storage of a page does not: a shot at another viewport, a clip and the idle close (60 s) each start with an empty one, as two browser contexts do. So when an app keeps its session in local storage, open its sign in at the viewport you shoot at; a request the page sees answered 401 or 403 prints its own WARN line. A theme: --theme <hub theme> draws the page with that prefers-color-scheme and the hub reads its `hub:theme` as that theme, written nowhere, so the next shot keeps none; with no flag every shot of the machine takes serve.shotTheme of the house config. Another place: --on <place> runs the same shot on a machine that reports to the hq (sk machines), over ssh, by its own `sk shot` from its house checkout, so its warm browser draws the page and its localhost is its own; each file comes back to --out and leaves its /tmp. A place that does not answer ssh, has no shot service or runs a shipkit whose sk shot refuses the ask fails in one line with the fix. wm, the GPU box, runs no shipkit place (no daemon, no pm, no shot service): --on wm is refused; a repo whose repo.config.ts names it in browsers.box already films on it with a plain sk shot.',
51
+ 'one warm headless chromium for the whole machine (the `shot` global process, started when down). A still reuses the warm page when it already shows the url, so a warm shot answers in about 0.1 s. A page with `<meta name="shot-ready" content="wait">` is shot once it sets content="ready"; any other page --wait ms after its load; a page that navigates while it loads (a sign in that redirects) gets its wait again where it lands. --full shoots the whole page at the width of the viewport: one file while the page fits the tallest side of its format (webp 16383 px, jpg and png 65535), else tiles in that format, <name>-1, <name>-2… top to bottom, every one printed, so nothing of the page is lost and the format stays the one asked (a jpg instead of a webp would change what the caller asked for, a cut would drop the end of the page); a whole page stops at 131072 px, the cut said in the note. A file of this machine is a url too (its path, or file://). --video films a page that is a canvas through its WebCodecs encoder (H.264 muxed with no second encode), and any other page as chromium paints it (its screencast, encoded by ffmpeg as the frames arrive); --dom films the page even when a canvas fills it. --step <hook> films frame by frame: before each frame the page draws its time t (seconds) in `await window[hook](t)`, then its ready mark, so a slow page films smooth at its fps; a canvas page is encoded by its own WebCodecs at the exact time n / fps, any other page a screenshot a frame. A still with --step is the page drawn at --at s. A session: cookies follow every shot (one jar in memory for the whole machine), the local storage of a page does not: a shot at another viewport, a clip and the idle close (60 s) each start with an empty one, as two browser contexts do. So when an app keeps its session in local storage, open its sign in at the viewport you shoot at; a request the page sees answered 401 or 403 prints its own WARN line. A theme: --theme <hub theme> draws the page with that prefers-color-scheme and the hub reads its `hub:theme` as that theme, written nowhere, so the next shot keeps none; with no flag every shot of the machine takes serve.shotTheme of the house config. Another place: --on <place> runs the same shot on a machine that reports to the hq (sk machines), over ssh, by its own `sk shot` from its house checkout, so its warm browser draws the page and its localhost is its own; each file comes back to --out and leaves its /tmp. A place that does not answer ssh, has no shot service or runs a shipkit whose sk shot refuses the ask fails in one line with the fix. A machine that runs no shipkit place (no daemon, no pm, no shot service) is refused; a repo whose repo.config.ts names such a box in browsers.box films on it with a plain sk shot.',
52
52
  examples: [
53
53
  ['a still of a running dev server', 'sk shot localhost:5173/'],
54
54
  ['a whole tall page at a phone width', 'sk shot :5173/guest --viewport 390,844 --full --out shots/guest.png'],
@@ -75,7 +75,7 @@ export class ShotCommand extends Command {
75
75
  step = Option.String('--step', { description: 'a window function the page draws time t (s) in: a clip steps it frame by frame, a still draws --at' })
76
76
  at = Option.String('--at', { description: 'with --step, the time a still is drawn at (default 0)' })
77
77
  theme = Option.String('--theme', { description: 'dark, dim, grey or light: the page drawn in that hub theme, this shot only (default the house config serve.shotTheme)' })
78
- on = Option.String('--on', { description: 'another place of the house (sk machines): the shot runs in its own warm browser, its localhost is its own, the file comes back to --out; wm, a box with no shipkit place, is refused' })
78
+ on = Option.String('--on', { description: 'another place of the house (sk machines): the shot runs in its own warm browser, its localhost is its own, the file comes back to --out; a box with no shipkit place is refused' })
79
79
  json = Option.Boolean('--json', false, { description: 'one json line: out, ms, phases, errors, note, via, and tiles when a whole page is tiled' })
80
80
 
81
81
  async execute(): Promise<number> {
@@ -5,14 +5,14 @@ import { Command, Option } from './clip.ts'
5
5
 
6
6
  export class StartCommand extends Command {
7
7
  static override paths = [['start']]
8
- static gloss = 'a new repo in ~/dev, on GitHub'
8
+ static gloss = 'a new repo beside your house, on GitHub'
9
9
 
10
10
  static override usage = Command.Usage({
11
11
  category: 'Setup',
12
- description: 'create or enter ~/dev/<name>, ready to work in: a private github repo and a push unless --no-github',
13
- details: 'create (or enter) ~/dev/<name> from ANY cwd, READY to work in. On any dir with no commit history it writes the day-one shape (package.json + src/index.ts + the project CLI on the kit (src/cli.ts, src/cli/cmd_Dev.ts, the cli script and a bin of the repo name) + lint/typecheck, tsconfig, .vscode tasks + settings, the verify skill, an agent/ wiki, .shipkit/reflections), installs the toolchain, wires shipkit (repo.config.ts via init), and runs the whole bootstrap chain: git init, first commit, PRIVATE github repo, push. Loose files ride in that first commit, and only a repo with real history is left as it is. Writes are create-only for files, additive for package.json scripts and .gitignore. CLAUDE.md is the house template on its own (its identity line comes at the first gate, SK003) (HOUSE_INCLUDE in src/start-repo.ts: the base wiki include, then `@./agent/index.md`, and --include overrides it), applied only on a machine where the house index exists, and the agent route lands last whenever the repo has agent/index.md. The house lines also opt the repo into the .claude/ policy files (a pre-approved shell allowlist + the attribution silencer), so a start with no house widens no agent permissions. Prints the dir on stdout so a shell alias can cd there. cwd-only sibling: `shipkit init`',
12
+ description: 'create or enter a repo beside your house: a private github repo and a push unless --no-github',
13
+ details: 'create (or enter) <name> in the folder your house sits in (~/dev with no house) from ANY cwd, READY to work in. On any dir with no commit history it writes the day-one shape (package.json + src/index.ts + the project CLI on the kit (src/cli.ts, src/cli/cmd_Dev.ts, the cli script and a bin of the repo name) + lint/typecheck, tsconfig, .vscode tasks + settings, the verify skill, an agent/ wiki, .shipkit/reflections), installs the toolchain, wires shipkit (repo.config.ts via init), and runs the whole bootstrap chain: git init, first commit, PRIVATE github repo, push. Loose files ride in that first commit, and only a repo with real history is left as it is. Writes are create-only for files, additive for package.json scripts and .gitignore. CLAUDE.md is the house template on its own (its identity line comes at the first gate, SK003) (the house of this machine first, then `@./agent/index.md`, and --include overrides it), applied only on a machine that has a house (`sk setup` makes one), and the agent route lands last whenever the repo has agent/index.md. The house lines also opt the repo into the .claude/ policy files (a pre-approved shell allowlist + the attribution silencer), so a start with no house widens no agent permissions. Prints the dir on stdout so a shell alias can cd there. cwd-only sibling: `shipkit init`',
14
14
  examples: [
15
- ['create or enter ~/dev/pong: dir, package.json, shipkit wiring, git, first commit, private github repo, push, the CLAUDE.md include lines', 'sk start pong'],
15
+ ['create or enter pong: dir, package.json, shipkit wiring, git, first commit, private github repo, push, the CLAUDE.md include lines', 'sk start pong'],
16
16
  ['another house: replace the include lines', "sk start pong --include '@~/wiki/index.md' --include '@./agent/index.md'"],
17
17
  ['adopt a pre-existing repo from anywhere', 'sk start my-old-project'],
18
18
  ['force the private github repo for a folder that was already there', 'sk start old-notes --github'],
@@ -22,8 +22,8 @@ export class StartCommand extends Command {
22
22
  })
23
23
 
24
24
  name = Option.String()
25
- root = Option.String('--root', { description: 'parent dir for repos (default ~/dev)' })
26
- include = Option.Array('--include', { description: 'line CLAUDE.md must carry, repeatable, order kept. Omitted: the house template (HOUSE_INCLUDE in src/start-repo.ts), the base wiki include then `@./agent/index.md`, and on a machine without that wiki the agent route alone' })
25
+ root = Option.String('--root', { description: 'parent dir for repos (default the folder the house sits in, ~/dev with no house)' })
26
+ include = Option.Array('--include', { description: 'line CLAUDE.md must carry, repeatable, order kept. Omitted: the house of this machine, then `@./agent/index.md`; on a machine with no house the agent route alone' })
27
27
  alsoOk = Option.Array('--also-ok', { description: 'alternative lines satisfying the first --include — never double-add. Omitted: `@./CLAUDE.local.md`, the public-repo indirection' })
28
28
  skip = Option.Array('--skip', { description: 'repo names shipkit never touches: no CLAUDE.md include, no wiring. Omitted: start.skip in the house config' })
29
29
  github = Option.Boolean('--github', { description: 'ON by default when a repo is being STARTED (a dir this run created, or one with a package.json): it gets a PRIVATE github repo wired as origin, and the first commit is pushed to it. Pass --github to force it for a pre-existing folder, --no-github to keep everything local, the first commit included (SHIPKIT_NO_GITHUB=1 does it for every run)' })
@@ -51,6 +51,8 @@ export class TimeCommand extends Command {
51
51
 
52
52
  async execute(): Promise<number> {
53
53
  const { VIEWS, render } = await import('../agent-time/render.ts')
54
+ const [{ accountLabel }, { readAccounts }] = await Promise.all([import('../agent-time/accounts-usage.ts'), import('../agent-time/accounts-usage-disk.ts')])
55
+ const plain = accountLabel('.claude', readAccounts())
54
56
  const { sinceOf } = await import('./kit/calls.ts')
55
57
  const err = this.context.stderr
56
58
  const tty = (err as { isTTY?: boolean }).isTTY === true
@@ -92,7 +94,7 @@ export class TimeCommand extends Command {
92
94
  const kept = this.fresh ? null : readKept(cacheDir, key, now)
93
95
  if (kept != null) {
94
96
  if (this.json) this.context.stdout.write(`${JSON.stringify(kept.report)}\n`)
95
- else this.context.stdout.write(`${render(kept.report, view, top)}\nas of ${new Date(kept.at).toTimeString().slice(0, 5)}: an answer is kept 5 minutes, --fresh reads again\n`)
97
+ else this.context.stdout.write(`${render(kept.report, view, top, plain)}\nas of ${new Date(kept.at).toTimeString().slice(0, 5)}: an answer is kept 5 minutes, --fresh reads again\n`)
96
98
  return 0
97
99
  }
98
100
  const roots = discoverConfigRoots()
@@ -143,7 +145,7 @@ export class TimeCommand extends Command {
143
145
  const report = buildReport(loaded, { repos: labels, from, to: now, repoOf: (p) => repoOfProject(p), hookMatchers }, loadMasker(repos[0] ?? null))
144
146
  writeKept(cacheDir, key, report, now)
145
147
  if (this.json) this.context.stdout.write(`${JSON.stringify(report)}\n`)
146
- else this.context.stdout.write(render(report, view, top))
148
+ else this.context.stdout.write(render(report, view, top, plain))
147
149
  if (!tty) err.write(indexed)
148
150
  return 0
149
151
  } finally {
@@ -2,7 +2,7 @@
2
2
  // loaded command page names it in the family's heading, so `sk commands --out` fails on a family missing here
3
3
  import { existsSync } from 'fs'
4
4
  import { homedir } from 'os'
5
- import { join } from 'path'
5
+ import { join, resolve, sep } from 'path'
6
6
 
7
7
  export const FAMILY_PAGES: Readonly<Record<string, string>> = {
8
8
  Annex: 'tools/shipkit/annex.md',
@@ -29,6 +29,16 @@ export const FAMILY_PAGES: Readonly<Record<string, string>> = {
29
29
  Wiki: 'tools/mdwiki/index.md',
30
30
  }
31
31
 
32
+ /** the families whose owner page exists in the wiki a page is in (`<root>/wiki/…`): a wiki of another house holds none
33
+ * of them, and a heading that names one is a dangling reference there. A page in no wiki keeps every family */
34
+ export function pagesIn(page: string, pages: Readonly<Record<string, string>>): Readonly<Record<string, string>> {
35
+ const parts = resolve(page).split(sep)
36
+ const at = parts.lastIndexOf('wiki', parts.length - 2)
37
+ if (at < 0) return pages
38
+ const wiki = parts.slice(0, at + 1).join(sep)
39
+ return Object.fromEntries(Object.entries(pages).filter(([, p]) => existsSync(join(wiki, p))))
40
+ }
41
+
32
42
  /** a page as a path any repo can read, when the lib runs from the house repo beside its wiki (`<house>/packages/rvlib-shipkit`);
33
43
  * from an install, the page's wiki path */
34
44
  export function pageAt(rel: string): string {
@@ -0,0 +1,34 @@
1
+ // the two pages of a new house that shipkit generates: every command, and what shows up in a thread. Pure text around
2
+ // the generators' blocks; `sk commands --everyday --out` and `sk thread kinds --out` rewrite the same blocks after an
3
+ // upgrade, so the markers are theirs. It ships on npm: no name, path or rule of one owner
4
+ import { BEGIN as COMMANDS_BEGIN, END as COMMANDS_END } from './cmd_Commands.ts'
5
+ import { BEGIN as KINDS_BEGIN, END as KINDS_END } from '../review/kind-catalog.ts'
6
+
7
+ export const HOUSE_COMMANDS = 'wiki/shipkit/commands.md'
8
+ export const HOUSE_THREAD_KINDS = 'wiki/shipkit/thread-kinds.md'
9
+
10
+ /** the pages by their path relative to the house root */
11
+ export function housePages(o: { commands: string; kinds: string }): Record<string, string> {
12
+ return {
13
+ [HOUSE_COMMANDS]: `# shipkit: every command
14
+
15
+ Generated: the everyday commands described, every other one named. One with its flags: \`sk <command> --help\`. After an upgrade of shipkit, in this house: \`sk commands --everyday --out ${HOUSE_COMMANDS}\`.
16
+
17
+ ${COMMANDS_BEGIN}
18
+
19
+ ${o.commands.trim()}
20
+
21
+ ${COMMANDS_END}
22
+ `,
23
+ [HOUSE_THREAD_KINDS]: `# shipkit: what shows up in a thread
24
+
25
+ A thread holds one subject, its address \`<kind>:<key>\`. Generated; a repo's own kinds: \`sk thread kinds\` in it. After an upgrade of shipkit, in this house: \`sk thread kinds --out ${HOUSE_THREAD_KINDS}\`.
26
+
27
+ ${KINDS_BEGIN}
28
+
29
+ ${o.kinds.trim()}
30
+
31
+ ${KINDS_END}
32
+ `,
33
+ }
34
+ }
@@ -15,7 +15,7 @@ export const MEMORY_EVERY_MS = 10 * 60_000
15
15
  export const MEMORY_STEP = 0.1
16
16
 
17
17
  /** what the daemon may hold, as its footprint: steady, and in its first BOOT_MS while every hub warms */
18
- export const MEMORY_BUDGET = { steady: 500 * 2 ** 20, boot: 1024 * 2 ** 20 }
18
+ export const MEMORY_BUDGET = { steady: 750 * 2 ** 20, boot: 1024 * 2 ** 20 }
19
19
  export const BOOT_MS = 5 * 60_000
20
20
  export const BUDGET_EVERY_MS = 30_000
21
21
  /** the machine db row of the daemon's last pass over its budget */
@@ -248,12 +248,14 @@ function derivedRuns(o: { gate: boolean; build: boolean; inputs?: string[]; ttl?
248
248
  }
249
249
 
250
250
  /** the cache half of a check file, as the key layer reads it */
251
- function declOfCache(cache: CacheDecl, env: CheckEnv): { inputs?: string[]; optional?: string[]; ttl?: string; never?: string; key?: string; reads?: boolean } {
251
+ function declOfCache(cache: CacheDecl, env: CheckEnv, off: string | null): { inputs?: string[]; optional?: string[]; ttl?: string; never?: string; key?: string; reads?: boolean } {
252
+ // a check that is off answers its reason, whatever its key would read: none is computed
253
+ const key = off == null && 'key' in cache ? cache.key?.(env) : undefined
252
254
  switch (cache.by) {
253
- case 'files': return { inputs: cache.inputs, optional: cache.optional, key: cache.key?.(env) }
255
+ case 'files': return { inputs: cache.inputs, optional: cache.optional, key }
254
256
  case 'reads': return { reads: true }
255
- case 'ttl': return { ttl: cache.span, key: cache.key?.(env) }
256
- case 'fact': return { ttl: FOREVER, key: cache.key(env) }
257
+ case 'ttl': return { ttl: cache.span, key }
258
+ case 'fact': return { ttl: FOREVER, key }
257
259
  case 'never': return { never: cache.why }
258
260
  }
259
261
  }
@@ -404,7 +406,7 @@ export async function composeChecks(root: string, c: RepoConfig, o: ComposeOpts
404
406
  for (const u of checks) {
405
407
  if (++n % COMPOSE_STEP === 0) await yieldLoop()
406
408
  const runs = fileRuns(u.def, u.id, c, env, foreign)
407
- const cache = declOfCache(u.def.cache, env)
409
+ const cache = declOfCache(u.def.cache, env, runs.off)
408
410
  // a body keyed on what it reads through its context (git-key.ts
409
411
  // READS). The tier is part of that question: a body can read the env,
410
412
  // and a quick answer must never stand in for a full one. Any module