rvlib-shipkit 2.13.0 → 2.14.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.
- package/CHANGELOG.md +32 -13
- package/package.json +1 -1
- package/src/assets/run-assets.ts +2 -2
- package/src/assets/server/studio-server.ts +27 -23
- package/src/check.ts +3 -3
- package/src/checks/SK001-package-json-shape.check.ts +4 -4
- package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
- package/src/checks/SK003-claude-md-shape.check.ts +19 -12
- package/src/checks/SK004-gitignore-policy.check.ts +18 -4
- package/src/checks/SK005-rvlib-versions.check.ts +1 -1
- package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
- package/src/checks/SK007-github-visibility.check.ts +2 -2
- package/src/checks/SK008-reviewer-agent.check.ts +1 -1
- package/src/checks/SK010-undeclared-unit.check.ts +2 -2
- package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +1 -1
- package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
- package/src/checks/SK015-nested-repo.check.ts +2 -2
- package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
- package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
- package/src/checks/SK018-test-files-run.check.ts +2 -2
- package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
- package/src/checks/SK020-self-spawning-check.check.ts +2 -2
- package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK025-release-drift.check.ts +2 -2
- package/src/checks/SK026-asks-autoclose.check.ts +2 -2
- package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
- package/src/checks/SK028-readme.check.ts +2 -2
- package/src/checks/SK029-explicit-check-files.check.ts +3 -3
- package/src/checks/SK030-cache-audit.check.ts +7 -5
- package/src/checks/SK031-trace-audit.check.ts +7 -7
- package/src/checks/SK032-ignored-inputs.check.ts +3 -3
- package/src/checks/SK033-global-contribution.check.ts +11 -4
- package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
- package/src/checks/SK035-public-clean.check.ts +4 -4
- package/src/checks/SK036-draft-media-size.check.ts +2 -2
- package/src/checks/SK037-keyword-additions.check.ts +43 -0
- package/src/cli/cmd_Backup.ts +2 -2
- package/src/cli/cmd_Commands.ts +4 -4
- package/src/cli/cmd_ConfigKeys.ts +2 -2
- package/src/cli/cmd_Drill.ts +1 -1
- package/src/cli/cmd_Home.ts +1 -1
- package/src/cli/cmd_Init.ts +1 -1
- package/src/cli/cmd_Media.ts +4 -4
- package/src/cli/cmd_Mv.ts +14 -7
- package/src/cli/cmd_Review.ts +2 -2
- package/src/cli/cmd_Smoke.ts +1 -1
- package/src/cli/cmd_Social.ts +3 -3
- package/src/cli/cmd_Sound.ts +1 -1
- package/src/cli/cmd_TraceAudit.ts +6 -6
- package/src/cli/cmd_Trailer.ts +2 -2
- package/src/cli/cmd_Veille.ts +2 -2
- package/src/cli/cmd_When.ts +2 -2
- package/src/cli/family-pages.ts +19 -19
- package/src/collections/collection-types.ts +2 -2
- package/src/collections/review.ts +1 -1
- package/src/comfy/comfy-panel.ts +2 -2
- package/src/contracts/manifests/discord.contract.ts +1 -1
- package/src/contracts/manifests/identity.contract.ts +1 -1
- package/src/contracts/manifests/itch.contract.ts +1 -1
- package/src/contracts/manifests/steam.contract.ts +1 -1
- package/src/core/agent-dir-at.ts +12 -0
- package/src/core/agent-dir.ts +16 -0
- package/src/core/budget.ts +1 -1
- package/src/core/canonical-scripts.ts +2 -2
- package/src/core/discover-checks.ts +1 -1
- package/src/core/global-contribution.ts +4 -1
- package/src/core/ignored-block.ts +1 -1
- package/src/core/ignored-inputs.ts +3 -2
- package/src/core/layout.ts +3 -3
- package/src/core/loop-watch.ts +1 -1
- package/src/core/motherhome.ts +2 -2
- package/src/core/one-way-in-policy.ts +8 -8
- package/src/core/run-ci.ts +3 -3
- package/src/core/runs-matrix.ts +1 -1
- package/src/core/slots.ts +14 -5
- package/src/core/trace-audit.ts +50 -9
- package/src/core/tree-rev.ts +1 -1
- package/src/drill/run.ts +1 -1
- package/src/home/daemon-jobs.ts +1 -1
- package/src/home/global-context.ts +11 -8
- package/src/home/gui-app/ShipkitGui.swift +91 -2
- package/src/home/inbox-shape.ts +1 -1
- package/src/home/inbox.ts +1 -1
- package/src/home/pm-config.ts +4 -1
- package/src/home/pm-inputs.ts +2 -0
- package/src/home/resources.ts +7 -2
- package/src/home/run-pm.ts +1 -1
- package/src/home/serve-web.ts +2 -2
- package/src/hooks/commit-message.ts +1 -1
- package/src/hooks/hook-gates.ts +1 -1
- package/src/hooks/leak-guard.ts +61 -8
- package/src/hooks/run-hooks.ts +18 -18
- package/src/identities/identities.ts +1 -1
- package/src/identities/machine-route.ts +1 -1
- package/src/identities/machine.ts +1 -1
- package/src/init-repo.ts +2 -2
- package/src/ledger/gate-checks.ts +1 -1
- package/src/ledger/record-kept.ts +1 -1
- package/src/media-kinds.ts +1 -1
- package/src/media-store/backup/daemon.ts +1 -1
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +1 -1
- package/src/media-store/backup/restore.ts +1 -1
- package/src/media-store/backup/run.ts +1 -1
- package/src/media-store/backup/secret.ts +1 -1
- package/src/media-store/backup/snapshot.ts +1 -1
- package/src/media-store/backup/sources.ts +1 -1
- package/src/media-store/content.ts +1 -1
- package/src/media-store/daemon.ts +1 -1
- package/src/media-store/db.ts +1 -1
- package/src/media-store/fact.ts +1 -1
- package/src/media-store/hand.ts +1 -1
- package/src/media-store/kind.ts +1 -1
- package/src/media-store/purge.ts +1 -1
- package/src/media-store/put.ts +1 -1
- package/src/media-store/remote.ts +1 -1
- package/src/media-store/space.ts +1 -1
- package/src/mv/mv-md.ts +63 -22
- package/src/pages/forward.ts +1 -1
- package/src/pages/frame-client.ts +1 -1
- package/src/pages/routes.ts +1 -1
- package/src/pages/unit.ts +1 -1
- package/src/plan/planner.ts +1 -1
- package/src/plan/repo-source.ts +1 -1
- package/src/release/public-clean.ts +25 -7
- package/src/release/run-bump.ts +1 -1
- package/src/release/run-release.ts +3 -3
- package/src/repo-config.ts +23 -16
- package/src/review/anim.ts +1 -1
- package/src/review/auto.ts +1 -1
- package/src/review/cells.ts +15 -1
- package/src/review/format.ts +2 -2
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +1 -1
- package/src/review/media-read.ts +1 -1
- package/src/review/model.ts +14 -4
- package/src/review/notes.ts +52 -4
- package/src/review/previews.ts +1 -1
- package/src/review/project.ts +1 -1
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +14 -2
- package/src/review/store.ts +2 -2
- package/src/review/threads.ts +1 -1
- package/src/review/trailer-desk.ts +3 -3
- package/src/review/trailer-media.ts +1 -1
- package/src/review/trailer-model.ts +1 -1
- package/src/review/trailer-routes.ts +1 -1
- package/src/review/trailer-shots.ts +1 -1
- package/src/review/unit.ts +1 -1
- package/src/scaffold/files/tsconfig.json +1 -1
- package/src/scaffold/project-scaffold.ts +1 -1
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/check-words.ts +1 -1
- package/src/serve/hub-app/frames-st.ts +1 -1
- package/src/serve/hub-app/hash-route.ts +1 -1
- package/src/serve/hub-app/home-st.ts +1 -1
- package/src/serve/hub-app/home-strip.css +1 -1
- package/src/serve/hub-app/hub-app.tsx +2 -2
- package/src/serve/hub-app/identities-st.ts +1 -1
- package/src/serve/hub-app/identities-view.tsx +5 -4
- package/src/serve/hub-app/identity-address.ts +1 -1
- package/src/serve/hub-app/inbox-st.ts +1 -1
- package/src/serve/hub-app/inbox-view.tsx +1 -1
- package/src/serve/hub-app/kept-cols.tsx +30 -0
- package/src/serve/hub-app/keys.ts +1 -1
- package/src/serve/hub-app/media-svc.ts +1 -1
- package/src/serve/hub-app/pages-frames.tsx +1 -1
- package/src/serve/hub-app/pages-svc.ts +1 -1
- package/src/serve/hub-app/projects-svc.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +1 -1
- package/src/serve/hub-app/review/review-board.tsx +1 -1
- package/src/serve/hub-app/review/review-cells.tsx +3 -2
- package/src/serve/hub-app/review/review-page.tsx +5 -4
- package/src/serve/hub-app/review/review-st.ts +15 -7
- package/src/serve/hub-app/review/review-thread.tsx +52 -5
- package/src/serve/hub-app/review/review-views.tsx +50 -33
- package/src/serve/hub-app/review/thread-st.ts +79 -27
- package/src/serve/hub-app/review/trailer-page.tsx +5 -4
- package/src/serve/hub-app/review/trailer-st.ts +1 -1
- package/src/serve/hub-app/review.css +9 -1
- package/src/serve/hub-app/site/site-part.tsx +1 -1
- package/src/serve/hub-app/site/site-st.ts +1 -1
- package/src/serve/hub-app/social/calendar.tsx +1 -1
- package/src/serve/hub-app/social/comms-page.tsx +29 -5
- package/src/serve/hub-app/social/kit.tsx +1 -1
- package/src/serve/hub-app/social/post-card.tsx +1 -1
- package/src/serve/hub-app/social/social-model.ts +1 -1
- package/src/serve/hub-app/social/social-page.tsx +12 -5
- package/src/serve/hub-app/social/social-st.ts +31 -3
- package/src/serve/hub-app/social.css +1 -1
- package/src/serve/hub-app/stores/stores-page.tsx +5 -4
- package/src/serve/hub-app/stores/stores-st.ts +1 -1
- package/src/serve/hub-app/stores.css +1 -1
- package/src/serve/hub-app/tree-row.tsx +1 -1
- package/src/serve/hub-app/veille/veille-page.tsx +5 -4
- package/src/serve/hub-app/veille/veille-st.ts +1 -1
- package/src/serve/hub-app/veille.css +1 -1
- package/src/serve/hub-runtime.ts +6 -2
- package/src/serve/project-gutter-route.ts +1 -1
- package/src/shot/box.ts +5 -7
- package/src/shot/browser-slot.ts +18 -6
- package/src/shot/client.ts +1 -2
- package/src/shot/clip-encoder.ts +16 -13
- package/src/shot/film-box.ts +132 -28
- package/src/shot/shooter.ts +21 -2
- package/src/shot/stepped-clip.ts +1 -1
- package/src/site/desk.ts +2 -2
- package/src/site/routes.ts +1 -1
- package/src/site/unit.ts +1 -1
- package/src/social/card-drafts.ts +24 -0
- package/src/social/compose.ts +2 -2
- package/src/social/desk-index.ts +1 -1
- package/src/social/desk-wire.ts +1 -1
- package/src/social/drafts.ts +3 -3
- package/src/social/load.ts +14 -1
- package/src/social/media-facts.ts +1 -1
- package/src/social/media-kind.ts +1 -1
- package/src/social/media-limit.ts +1 -1
- package/src/social/media-of.ts +1 -1
- package/src/social/migrate.ts +1 -1
- package/src/social/post-url.ts +1 -1
- package/src/social/presence.ts +2 -2
- package/src/social/public-read.ts +1 -1
- package/src/social/publish/bluesky.ts +1 -1
- package/src/social/publish/discord.ts +1 -1
- package/src/social/push.ts +10 -4
- package/src/social/richtext.ts +1 -1
- package/src/social/routes.ts +10 -4
- package/src/social/stats.ts +1 -1
- package/src/social/text.ts +1 -1
- package/src/social/tracker-route.ts +1 -1
- package/src/social/tracker.ts +1 -1
- package/src/social/unit.ts +1 -1
- package/src/social/writes.ts +1 -1
- package/src/stores/collection.ts +1 -1
- package/src/stores/desk.ts +1 -1
- package/src/stores/model.ts +1 -1
- package/src/stores/routes.ts +1 -1
- package/src/stores/unit.ts +1 -1
- package/src/suite/judge-suites.ts +1 -1
- package/src/trace/tracer.ts +12 -5
- package/src/trailer/adapter.ts +1 -1
- package/src/trailer/build.ts +6 -4
- package/src/trailer/holes.ts +1 -1
- package/src/trailer/passage.ts +1 -1
- package/src/trailer/prune.ts +1 -1
- package/src/trailer/states.ts +1 -1
- package/src/trailer/versions.ts +1 -1
- package/src/trailer/words.ts +1 -1
- package/src/tui/run-tui.ts +1 -1
- package/src/tui/tui-store.ts +1 -1
- package/src/veille/asks.ts +1 -1
- package/src/veille/auto.ts +1 -1
- package/src/veille/batch.ts +1 -1
- package/src/veille/chrome.ts +1 -1
- package/src/veille/collection.ts +1 -1
- package/src/veille/desk.ts +1 -1
- package/src/veille/identity.ts +1 -1
- package/src/veille/import.ts +1 -1
- package/src/veille/log.ts +1 -1
- package/src/veille/platforms.ts +1 -1
- package/src/veille/reads.ts +1 -1
- package/src/veille/replied.ts +1 -1
- package/src/veille/routes.ts +2 -2
- package/src/veille/watch.ts +1 -1
- package/src/veille/worth.ts +2 -2
package/src/cli/cmd_Mv.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// reference in the code. Renaming used to mean knowing WHICH tool applied,
|
|
5
5
|
// and knowing that is exactly the kind of doubt the toolkit exists to remove.
|
|
6
6
|
import { Command, Option } from 'clipanion'
|
|
7
|
-
import {
|
|
7
|
+
import { readFileSync } from 'fs'
|
|
8
|
+
import { movePage, movePages, parseMoveMap } from '../mv/mv-md.ts'
|
|
8
9
|
import { renameCli } from '../ts/rename.ts'
|
|
9
10
|
|
|
10
11
|
export class MvCommand extends Command {
|
|
@@ -20,17 +21,26 @@ export class MvCommand extends Command {
|
|
|
20
21
|
['apply + one conventional commit', 'sk mv docs/old-name.md docs/new-name.md --commit'],
|
|
21
22
|
['a code file, every import rewritten', 'sk mv src/old-mod.ts src/new-mod.ts --write'],
|
|
22
23
|
['a whole folder', 'sk mv src/old-dir src/new-dir --write'],
|
|
24
|
+
['md pages from a move map, one `<old> <new>` per line', 'sk mv --map moves.txt --write'],
|
|
25
|
+
['a page becomes a topic folder: its asset dir is the folder, the page its index.md', 'sk mv wiki/build/ts.md wiki/patterns/ts/index.md --write'],
|
|
23
26
|
],
|
|
24
27
|
})
|
|
25
28
|
|
|
26
|
-
oldPath = Option.String()
|
|
27
|
-
newPath = Option.String()
|
|
29
|
+
oldPath = Option.String({ required: false })
|
|
30
|
+
newPath = Option.String({ required: false })
|
|
31
|
+
map = Option.String('--map', { description: 'md pages from a file, one `<old> <new>` per line, mv:after once at the end' })
|
|
28
32
|
write = Option.Boolean('--write', false, { description: 'apply (default is a dry run)' })
|
|
29
33
|
commit = Option.Boolean('--commit', false, { description: 'apply + git commit, md pages only (the pre-commit gate still runs)' })
|
|
30
34
|
|
|
31
35
|
async execute(): Promise<number> {
|
|
32
36
|
const write = this.write || this.commit
|
|
37
|
+
const io = { print: (l: string) => this.context.stdout.write(`${l}\n`), printErr: (l: string) => this.context.stderr.write(`${l}\n`) }
|
|
33
38
|
try {
|
|
39
|
+
if (this.map != null) {
|
|
40
|
+
if (this.oldPath != null) { io.printErr('FAIL: --map takes no paths'); return 1 }
|
|
41
|
+
return movePages(process.cwd(), parseMoveMap(readFileSync(this.map, 'utf8')), io, { write: this.write, commit: this.commit })
|
|
42
|
+
}
|
|
43
|
+
if (this.oldPath == null || this.newPath == null) { io.printErr('FAIL: give <oldPath> <newPath>, or --map <file>'); return 1 }
|
|
34
44
|
const isMd = this.oldPath.endsWith('.md') || this.newPath.endsWith('.md')
|
|
35
45
|
if (!isMd) {
|
|
36
46
|
if (this.commit) {
|
|
@@ -43,10 +53,7 @@ export class MvCommand extends Command {
|
|
|
43
53
|
if (!write && code === 0) this.context.stdout.write('note: dry run — pass --write to apply\n')
|
|
44
54
|
return code
|
|
45
55
|
}
|
|
46
|
-
return movePage(process.cwd(), this.oldPath, this.newPath, {
|
|
47
|
-
print: (l) => this.context.stdout.write(`${l}\n`),
|
|
48
|
-
printErr: (l) => this.context.stderr.write(`${l}\n`),
|
|
49
|
-
}, { write: this.write, commit: this.commit })
|
|
56
|
+
return movePage(process.cwd(), this.oldPath, this.newPath, io, { write: this.write, commit: this.commit })
|
|
50
57
|
} catch (e) {
|
|
51
58
|
this.context.stderr.write(`FAIL: ${e instanceof Error ? e.message : String(e)}\n`)
|
|
52
59
|
return 1
|
package/src/cli/cmd_Review.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// sk review: an agent shows the owner something as one card of the one store and reads his answer; a dispatcher routes
|
|
2
|
-
// what he, a player or a rule raised, a worker claims and closes it (review/store.ts, wiki
|
|
2
|
+
// what he, a player or a rule raised, a worker claims and closes it (review/store.ts, wiki tools/shipkit/review.md).
|
|
3
3
|
// Every module loads inside execute: the cli registers this file on every `sk` call
|
|
4
4
|
import { Command, Option } from 'clipanion'
|
|
5
5
|
|
|
6
|
-
const DETAILS = `the one feedback store, .shipkit/review/<id>/: one subject is one card (other angles are views of it, a follow up --supersedes it), he answers it in the hub's review entry (approved, ok with a fix, rejected, archived, rectangles, reactions per view), you read his answer with inbox or watch. What he, a player or a rule raises is an item of the same store: a dispatcher routes it to a topic, a worker claims it and closes it. The repo's review unit names its kinds, topics, sources and rules. SK_AGENT names your lane. Page: wiki
|
|
6
|
+
const DETAILS = `the one feedback store, .shipkit/review/<id>/: one subject is one card (other angles are views of it, a follow up --supersedes it), he answers it in the hub's review entry (approved, ok with a fix, rejected, archived, rectangles, reactions per view), you read his answer with inbox or watch. What he, a player or a rule raises is an item of the same store: a dispatcher routes it to a topic, a worker claims it and closes it. The repo's review unit names its kinds, topics, sources and rules. SK_AGENT names your lane. Page: wiki tools/shipkit/review.md`
|
|
7
7
|
|
|
8
8
|
type Ctx = { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }
|
|
9
9
|
type Unit = import('../review/unit.ts').ReviewUnit
|
package/src/cli/cmd_Smoke.ts
CHANGED
|
@@ -28,7 +28,7 @@ export class SmokeCommand extends Command {
|
|
|
28
28
|
const config = await loadRepoConfig(root)
|
|
29
29
|
const w = (l: string) => this.context.stdout.write(`${l}\n`)
|
|
30
30
|
if (config.smoke == null) {
|
|
31
|
-
w(`FAIL this repo declares no smoke config — add \`smoke: { base, routes, login? }\` to repo.config.ts (
|
|
31
|
+
w(`FAIL this repo declares no smoke config — add \`smoke: { base, routes, login? }\` to repo.config.ts (tools/shipkit/index.md)`)
|
|
32
32
|
return 1
|
|
33
33
|
}
|
|
34
34
|
try {
|
package/src/cli/cmd_Social.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sk social and sk identities: who speaks, and where a repo stands in public (wiki
|
|
1
|
+
// sk social and sk identities: who speaks, and where a repo stands in public (wiki tools/shipkit/social.md, `sk
|
|
2
2
|
// social`). Every module loads inside execute: the cli registers this file on every `sk` call
|
|
3
3
|
import { Command, Option } from 'clipanion'
|
|
4
4
|
|
|
@@ -34,7 +34,7 @@ class SocialCommand extends Command {
|
|
|
34
34
|
category: 'Social',
|
|
35
35
|
description: 'where the repo stands in public: posts per account, the rhythm, kinds, topics, hashtags, what waits',
|
|
36
36
|
details:
|
|
37
|
-
'Every posted line of .shipkit/social/drafts as one post, dated from its id, else from the commit that recorded it. The public numbers come from the free reads (Bluesky, Mastodon, a Discord invite), cached 30 minutes; every other account says unknown. --offline skips them. Page: wiki
|
|
37
|
+
'Every posted line of .shipkit/social/drafts as one post, dated from its id, else from the commit that recorded it. The public numbers come from the free reads (Bluesky, Mastodon, a Discord invite), cached 30 minutes; every other account says unknown. --offline skips them. Page: wiki tools/shipkit/social.md',
|
|
38
38
|
examples: [
|
|
39
39
|
['the overview', 'sk social'],
|
|
40
40
|
['with no network', 'sk social --offline'],
|
|
@@ -192,7 +192,7 @@ class IdentitiesCommand extends Command {
|
|
|
192
192
|
static override usage = Command.Usage({
|
|
193
193
|
category: 'Social',
|
|
194
194
|
description: 'every identity of the machine: its accounts online over its accounts, and the repos speaking as it',
|
|
195
|
-
details: "One folder an identity in the house repo's .shipkit/identities/. A repo names its own with speaksAs in repo.config.ts; the default identity speaks for a repo that names none. Page: wiki
|
|
195
|
+
details: "One folder an identity in the house repo's .shipkit/identities/. A repo names its own with speaksAs in repo.config.ts; the default identity speaks for a repo that names none. Page: wiki tools/shipkit/social.md",
|
|
196
196
|
examples: [['every identity', 'sk identities'], ['as json', 'sk identities --json']],
|
|
197
197
|
})
|
|
198
198
|
json = Option.Boolean('--json', false, { description: 'one json object' })
|
package/src/cli/cmd_Sound.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// module loads inside execute: the cli registers this file on every `sk` call
|
|
4
4
|
import { Command, Option } from 'clipanion'
|
|
5
5
|
|
|
6
|
-
const PAGE = 'Page: wiki
|
|
6
|
+
const PAGE = 'Page: wiki tools/trailer/index.md, Sound'
|
|
7
7
|
|
|
8
8
|
async function run(context: { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }, body: (say: (l: string) => void, root: string, cwd: string) => Promise<void>): Promise<number> {
|
|
9
9
|
const say = (l: string): void => void context.stdout.write(`${l}\n`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// sk trace-audit — which
|
|
2
|
-
//
|
|
1
|
+
// sk trace-audit — which paths each gate task reads that its key cannot
|
|
2
|
+
// see (gitignored, or tracked outside a declared list), found by running the task once under the tracer, and with
|
|
3
3
|
// --fix written into repo.config.ts (core/trace-audit.ts).
|
|
4
4
|
import { Command, Option } from 'clipanion'
|
|
5
5
|
import { loadRepoConfig } from '../repo-config.ts'
|
|
@@ -12,8 +12,8 @@ export class TraceAuditCommand extends Command {
|
|
|
12
12
|
|
|
13
13
|
static override usage = Command.Usage({
|
|
14
14
|
category: 'Health',
|
|
15
|
-
description: '
|
|
16
|
-
details: 'Runs each gate task once under the tracer (on by default: --disable for this machine, or SHIPKIT_TRACE=0 for one run) and lists the
|
|
15
|
+
description: 'paths a gate task reads that its key misses, found by tracing it once',
|
|
16
|
+
details: 'Runs each gate task once under the tracer (on by default: --disable for this machine, or SHIPKIT_TRACE=0 for one run) and lists the paths it read that its key misses: a gitignored one that repo.config ignoredInputs does not name, and for a task with a declared inputs list (the test and typecheck of a unit), a tracked file outside that list. The answer is kept for about a day under the git common dir, where every worktree reads it, and each finding joins the key of the task that read it at once. --fix writes the findings into the managed block of repo.config.ts, per task, without tracing again. Exit 1 when a key misses something.',
|
|
17
17
|
examples: [
|
|
18
18
|
['audit, reusing a recent answer', 'sk trace-audit'],
|
|
19
19
|
['trace again now', 'sk trace-audit --fresh'],
|
|
@@ -53,8 +53,8 @@ export class TraceAuditCommand extends Command {
|
|
|
53
53
|
if (r.skipped != null) { out(`skip: nothing traced: ${r.skipped}`); return 0 }
|
|
54
54
|
for (const t of r.tasks) {
|
|
55
55
|
if (t.status === 'unaudited') out(`WARN ${t.id} could not be audited: ${t.why}`)
|
|
56
|
-
else if (t.uncovered.length > 0) out(`FAIL: ${t.id} reads ${t.uncovered.length}
|
|
57
|
-
else out(`ok: ${t.id}: its key covers every
|
|
56
|
+
else if (t.uncovered.length > 0) out(`FAIL: ${t.id} reads ${t.uncovered.length} path(s) its key misses: ${t.uncovered.slice(0, 5).join(', ')}${t.uncovered.length > 5 ? ', …' : ''}`)
|
|
57
|
+
else out(`ok: ${t.id}: its key covers every path it read`)
|
|
58
58
|
}
|
|
59
59
|
if (missing.length > 0) out(` fix: sk trace-audit --fix adds ${describeByTask(Object.fromEntries(missing.map((t) => [t.id, t.propose])))} to repo.config.ts ignoredInputs`)
|
|
60
60
|
return missing.length > 0 ? 1 : 0
|
package/src/cli/cmd_Trailer.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { Command, Option } from 'clipanion'
|
|
4
4
|
import { pageAt } from './family-pages.ts'
|
|
5
5
|
|
|
6
|
-
const PAGE = pageAt('
|
|
7
|
-
const DETAILS = `the trailer language: shots with a film line each (clip <file>, image <file>, card, run "<cmd {out}>", url <route> through the shot service, grid and split of other takes, or a film row of the project CLI), footage blocks, titles in the brand's look, cuts, sections in bars, music, sfx and voice; a \`vertical\` header finishes a short with the brand's lockup, watermark and end card. A repo plugs in one trailer({...}) unit: sounds by id, the world's paths, content checks, a line's own take. Outputs land in trailer/<trailer>/out/. Read first: ${PAGE}, then its folder
|
|
6
|
+
const PAGE = pageAt('tools/trailer/index.md')
|
|
7
|
+
const DETAILS = `the trailer language: shots with a film line each (clip <file>, image <file>, card, run "<cmd {out}>", url <route> through the shot service, grid and split of other takes, or a film row of the project CLI), footage blocks, titles in the brand's look, cuts, sections in bars, music, sfx and voice; a \`vertical\` header finishes a short with the brand's lockup, watermark and end card. A repo plugs in one trailer({...}) unit: sounds by id, the world's paths, content checks, a line's own take. Outputs land in trailer/<trailer>/out/. Read first: ${PAGE}, then its folder tools/trailer/ (the score, the craft, a book of ideas, extending the language)`
|
|
8
8
|
|
|
9
9
|
/** --refilm alone: every stale take; --refilm a,b: those shots */
|
|
10
10
|
const refilmOf = (v: string | boolean | undefined): 'stale' | ReadonlySet<string> | null => (v === undefined || v === false ? null : v === true ? 'stale' : new Set(v.split(',')))
|
package/src/cli/cmd_Veille.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sk veille: an identity's Veille for agents (veille/, wiki
|
|
1
|
+
// sk veille: an identity's Veille for agents (veille/, wiki tools/shipkit/veille.md, For agents: never the raw log): the
|
|
2
2
|
// feed as compact lines, one reply's brief or its draft, a pass with its reason, an older log brought in. Every module
|
|
3
3
|
// loads inside execute: the cli registers this file on every `sk` call
|
|
4
4
|
import { Command, Option } from 'clipanion'
|
|
@@ -48,7 +48,7 @@ export class VeilleFeedCommand extends Command {
|
|
|
48
48
|
category: 'Veille',
|
|
49
49
|
description: 'the posts an identity scrolled past, ranked by the worth of a reply: one compact line each',
|
|
50
50
|
details:
|
|
51
|
-
"From the identity's log in shipkit's home: platform, author, their followers, age, likes, reposts, replies, views, the worth of a reply (w0 to w100), the subreddit, about 100 characters of text, its key. Only the active posts (worth at or over the rule maybe, not handled) unless --all; a platform switched off is left out unless --platform names it. Page: wiki
|
|
51
|
+
"From the identity's log in shipkit's home: platform, author, their followers, age, likes, reposts, replies, views, the worth of a reply (w0 to w100), the subreddit, about 100 characters of text, its key. Only the active posts (worth at or over the rule maybe, not handled) unless --all; a platform switched off is left out unless --platform names it. Page: wiki tools/shipkit/veille.md",
|
|
52
52
|
examples: [
|
|
53
53
|
['the best twenty of the last day', 'sk veille feed'],
|
|
54
54
|
['X only, the last three days', 'sk veille feed --platform x --since 3d'],
|
package/src/cli/cmd_When.ts
CHANGED
|
@@ -23,8 +23,8 @@ export class WhenCommand extends Command {
|
|
|
23
23
|
['only what the quick gate runs', 'sk when --only onCi'],
|
|
24
24
|
['the matrix without the legend', 'sk when --no-legend'],
|
|
25
25
|
['machine-readable', 'sk when --json'],
|
|
26
|
-
['write the legend into a docs page between its markers', 'sk when --out wiki/
|
|
27
|
-
['fail if that page is stale (lint mode)', 'sk when --out wiki/
|
|
26
|
+
['write the legend into a docs page between its markers', 'sk when --out wiki/tools/shipkit/runs.md'],
|
|
27
|
+
['fail if that page is stale (lint mode)', 'sk when --out wiki/tools/shipkit/runs.md --check'],
|
|
28
28
|
],
|
|
29
29
|
})
|
|
30
30
|
|
package/src/cli/family-pages.ts
CHANGED
|
@@ -5,29 +5,29 @@ import { homedir } from 'os'
|
|
|
5
5
|
import { join } from 'path'
|
|
6
6
|
|
|
7
7
|
export const FAMILY_PAGES: Readonly<Record<string, string>> = {
|
|
8
|
-
Asks: '
|
|
9
|
-
Assets: '
|
|
10
|
-
Drill: '
|
|
11
|
-
Gate: '
|
|
12
|
-
Health: '
|
|
13
|
-
Home: '
|
|
14
|
-
Media: '
|
|
15
|
-
Refactor: '
|
|
16
|
-
Review: '
|
|
17
|
-
Scaffold: '
|
|
18
|
-
Serve: '
|
|
19
|
-
Setup: '
|
|
20
|
-
Social: '
|
|
21
|
-
Sound: '
|
|
22
|
-
Trailer: '
|
|
23
|
-
Veille: '
|
|
24
|
-
Wiki: '
|
|
8
|
+
Asks: 'preferences/human-loop/index.md',
|
|
9
|
+
Assets: 'tools/generate-assets/index.md',
|
|
10
|
+
Drill: 'meta/speed-up-agents/index.md',
|
|
11
|
+
Gate: 'tools/shipkit/index.md',
|
|
12
|
+
Health: 'tools/shipkit/index.md',
|
|
13
|
+
Home: 'tools/shipkit/home.md',
|
|
14
|
+
Media: 'tools/shipkit/media-store.md',
|
|
15
|
+
Refactor: 'patterns/typescript/index.md',
|
|
16
|
+
Review: 'tools/shipkit/review.md',
|
|
17
|
+
Scaffold: 'patterns/pocketbase/index.md',
|
|
18
|
+
Serve: 'tools/shipkit/home.md',
|
|
19
|
+
Setup: 'patterns/rv-conventions/index.md',
|
|
20
|
+
Social: 'tools/shipkit/social.md',
|
|
21
|
+
Sound: 'tools/trailer/index.md',
|
|
22
|
+
Trailer: 'tools/trailer/index.md',
|
|
23
|
+
Veille: 'tools/shipkit/veille.md',
|
|
24
|
+
Wiki: 'tools/mdwiki/index.md',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/** a page as a path any repo can read, when the lib runs from
|
|
27
|
+
/** a page as a path any repo can read, when the lib runs from the house repo beside its wiki (`<house>/packages/rvlib-shipkit`);
|
|
28
28
|
* from an install, the page's wiki path */
|
|
29
29
|
export function pageAt(rel: string): string {
|
|
30
|
-
const abs = join(import.meta.dir, '
|
|
30
|
+
const abs = join(import.meta.dir, '../../../../wiki', rel)
|
|
31
31
|
if (!existsSync(abs)) return `wiki ${rel}`
|
|
32
32
|
const home = homedir()
|
|
33
33
|
return abs.startsWith(`${home}/`) ? `~${abs.slice(home.length)}` : abs
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// feed, the studio browse, and `shipkit needs`. Truth files never move to
|
|
4
4
|
// fit the UI — a Collection only READS its source. Severity: yellow = a
|
|
5
5
|
// default is in use, taste pending; red = missing with no inventable
|
|
6
|
-
// default, or a paste-from-elsewhere. Doctrine page:
|
|
6
|
+
// default, or a paste-from-elsewhere. Doctrine page: tools/shipkit/collections in
|
|
7
7
|
// the docs wiki this lib ships beside.
|
|
8
8
|
|
|
9
9
|
import { yieldLoop } from '../core/loop-watch.ts'
|
|
@@ -333,7 +333,7 @@ export type OnCollector = (collection: string, error: string | null) => void
|
|
|
333
333
|
|
|
334
334
|
/** every resource of every collection, failure-isolated per collection: a
|
|
335
335
|
* broken source reports itself as ONE red row, never blanks the tree. The
|
|
336
|
-
* loop is given back between two collections (wiki
|
|
336
|
+
* loop is given back between two collections (wiki tools/shipkit/home.md,
|
|
337
337
|
* Nothing heavy on the daemon's loop) */
|
|
338
338
|
export async function projectResources(collections: Collection[], onCollector?: OnCollector): Promise<Resource[]> {
|
|
339
339
|
const out: Resource[] = []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// the review store and the trailer cuts as tree rows (wiki
|
|
1
|
+
// the review store and the trailer cuts as tree rows (wiki tools/shipkit/review.md). Under the review section, one row a
|
|
2
2
|
// card that waits on HIM (the owner's verdict, his answer to a question): yellow, so `sk needs` lists it too. Under the trailer
|
|
3
3
|
// section, one row a cut, its open frame notes in the slot: they wait on agents, never on him, so a cut is never yellow.
|
|
4
4
|
// Each collection exists only where the repo has its folder, so a repo with none draws the section greyed
|
package/src/comfy/comfy-panel.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// the comfy section's backend: the repo's .shipkit/comfy/ workflow modules, the
|
|
2
2
|
// comfy-ts serve panel the hub embeds to tune and test one, and the box those
|
|
3
|
-
// modules generate on. The contract this reads is owned by
|
|
3
|
+
// modules generate on. The contract this reads is owned by tools/comfyui/index.md.
|
|
4
4
|
//
|
|
5
5
|
// The panel is a CHILD PROCESS rather than a route: comfy-ts owns that ui, and
|
|
6
6
|
// a second implementation of a var form inside the hub is the redundant
|
|
@@ -15,7 +15,7 @@ export type ComfyPanelUp = { url: string; port: number }
|
|
|
15
15
|
export type ComfyBox = { url: string; err: string | null }
|
|
16
16
|
|
|
17
17
|
const SUFFIX = '.cflow.ts'
|
|
18
|
-
/** the wm facts (
|
|
18
|
+
/** the wm facts (tools/comfyui/index.md) — an absent key defaults to them */
|
|
19
19
|
const DEFAULT_BOX_PORT = 8085
|
|
20
20
|
|
|
21
21
|
export const comfyWorkflowsDir = (root: string): string => join(root, '.shipkit/comfy', 'workflows')
|
|
@@ -5,7 +5,7 @@ import { defineContract, dirExists, md, png } from 'rvlib-shipkit/src/contracts/
|
|
|
5
5
|
export default defineContract({
|
|
6
6
|
venue: 'discord',
|
|
7
7
|
dir: '.shipkit/discord',
|
|
8
|
-
owner: '
|
|
8
|
+
owner: 'guides/post-publicly/index.md',
|
|
9
9
|
appliesTo: 'declared',
|
|
10
10
|
detect: [dirExists('.shipkit/discord')],
|
|
11
11
|
artifacts: [
|
|
@@ -7,7 +7,7 @@ import { defineContract, file, glob, png } from 'rvlib-shipkit/src/contracts/con
|
|
|
7
7
|
export default defineContract({
|
|
8
8
|
venue: 'identity',
|
|
9
9
|
dir: '.shipkit/identity',
|
|
10
|
-
owner: '
|
|
10
|
+
owner: 'tools/generate-assets/index.md',
|
|
11
11
|
appliesTo: 'always',
|
|
12
12
|
gate: 'public-surface',
|
|
13
13
|
detect: [],
|
|
@@ -4,7 +4,7 @@ import { custom, defineContract, dirExists, fileContains, glob, md, png, script
|
|
|
4
4
|
export default defineContract({
|
|
5
5
|
venue: 'itch',
|
|
6
6
|
dir: '.shipkit/itch',
|
|
7
|
-
owner: '
|
|
7
|
+
owner: 'guides/itch/index.md',
|
|
8
8
|
appliesTo: 'declared',
|
|
9
9
|
detect: [script('^(up|push):itch$'), fileContains('deploy.sh', 'butler push'), dirExists('.shipkit/itch')],
|
|
10
10
|
artifacts: [
|
|
@@ -5,7 +5,7 @@ import { custom, defineContract, dirExists, file, fileContains, glob, md, png, s
|
|
|
5
5
|
export default defineContract({
|
|
6
6
|
venue: 'steam',
|
|
7
7
|
dir: '.shipkit/steam',
|
|
8
|
-
owner: '
|
|
8
|
+
owner: 'guides/steam/index.md',
|
|
9
9
|
appliesTo: 'declared',
|
|
10
10
|
detect: [script('^(up|push):steam$'), fileContains('deploy.sh', 'run_app_build'), dirExists('.shipkit/steam')],
|
|
11
11
|
artifacts: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// the agent folder of a repo on disk (core/agent-dir.ts owns the rule)
|
|
2
|
+
import { readFileSync } from 'fs'
|
|
3
|
+
import { join } from 'path'
|
|
4
|
+
import { DEFAULT_AGENT_DIR, agentDirOf } from './agent-dir.ts'
|
|
5
|
+
|
|
6
|
+
/** the agent folder of the repo at `root` */
|
|
7
|
+
export function agentDirAt(root: string): string {
|
|
8
|
+
try { return agentDirOf(readFileSync(join(root, 'CLAUDE.md'), 'utf8')) } catch { return DEFAULT_AGENT_DIR }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** the repo's own global contribution file, in the agent folder its CLAUDE.md names */
|
|
12
|
+
export const contributionFileAt = (root: string): string => `${agentDirAt(root)}/global-contribution.md`
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// a repo's agent folder: the folder CLAUDE.md's LAST include names
|
|
2
|
+
// (`@./<dir>/index.md`). `agent` by default; a repo that hosts a base wiki may
|
|
3
|
+
// name a folder of it. CLAUDE.md is the one place it is declared. Pure: the
|
|
4
|
+
// disk side is agent-dir-at.ts, so a cached check importing this reads nothing.
|
|
5
|
+
|
|
6
|
+
export const DEFAULT_AGENT_DIR = 'agent'
|
|
7
|
+
|
|
8
|
+
/** the agent folder a CLAUDE.md text names, DEFAULT_AGENT_DIR when it names none */
|
|
9
|
+
export function agentDirOf(claude: string | null): string {
|
|
10
|
+
const last = (claude ?? '').split('\n').map((l) => l.trim()).filter((l) => l.startsWith('@')).at(-1)
|
|
11
|
+
const m = last == null ? null : /^@\.\/((?:[\w.-]+\/)*[\w.-]+)\/index\.md$/.exec(last)
|
|
12
|
+
return m?.[1] ?? DEFAULT_AGENT_DIR
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** a folder of another wiki (`docs/wiki/agent`), whose own lint and graph cover it */
|
|
16
|
+
export const nestedAgentDir = (dir: string): boolean => dir.includes('/')
|
package/src/core/budget.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { availableParallelism, loadavg } from 'os'
|
|
|
7
7
|
import type { MachineLoad } from '../suite/judge-suites.ts'
|
|
8
8
|
|
|
9
9
|
/** an in process body, a rule or a page check: the house bar is under 1 s
|
|
10
|
-
* (
|
|
10
|
+
* (preferences/how-we-work/index.md, Velocity). The median rule answers in under 50ms */
|
|
11
11
|
export const IN_PROCESS_BUDGET_MS = 1_000
|
|
12
12
|
|
|
13
13
|
/** a subprocess (a build step, a test suite, a `cmd` check) or a world probe
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The canonical package.json script bodies for a shipkit repo — vocabulary
|
|
2
|
-
// owned by
|
|
2
|
+
// owned by patterns/rv-conventions/package-json.md. ONE source: `shipkit init`
|
|
3
3
|
// scaffolds from it and rule SK001's autofix repairs from it.
|
|
4
4
|
//
|
|
5
5
|
// a script that only forwards to a shipkit verb is NOT canon: the verb is the
|
|
@@ -30,7 +30,7 @@ export function conditionalBodies(_opts: ScriptStyle = {}): Record<string, strin
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// ONE WAY IN (
|
|
33
|
+
// ONE WAY IN (tools/shipkit/one-way-in.md): the verification verbs an agent types from
|
|
34
34
|
// muscle memory ROUTE to shipkit, so `bun run test` gets the cache and the
|
|
35
35
|
// job attachment without anyone having to remember a rule. The tool body they
|
|
36
36
|
// used to hold moves to `<name>:raw`, which is what shipkit itself runs and
|
|
@@ -206,7 +206,7 @@ function brokenBuiltin(path: string, message: string): CheckDef {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
const BUILTIN_OWNER = '
|
|
209
|
+
const BUILTIN_OWNER = 'tools/shipkit/built-in-checks.md'
|
|
210
210
|
|
|
211
211
|
/** every check this repo can run: its own files, plus the toolkit's. Throws
|
|
212
212
|
* on a registration nobody can act on (a duplicate id, a repo check squatting
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
// everywhere: CONTRIBUTION_MAX_LINES and CONTRIBUTION_MAX_BYTES bound it.
|
|
6
6
|
|
|
7
7
|
import { readFileSync } from 'fs'
|
|
8
|
+
import { DEFAULT_AGENT_DIR } from './agent-dir.ts'
|
|
9
|
+
|
|
10
|
+
/** where a repo with the default agent folder keeps it */
|
|
11
|
+
export const CONTRIBUTION_FILE = `${DEFAULT_AGENT_DIR}/global-contribution.md`
|
|
8
12
|
|
|
9
|
-
export const CONTRIBUTION_FILE = 'agent/global-contribution.md'
|
|
10
13
|
/** the line a house index carries to load the generated context */
|
|
11
14
|
export const CONTEXT_INCLUDE = '@generated/global-context.md'
|
|
12
15
|
export const CONTRIBUTION_MAX_LINES = 40
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// THE IGNORED INPUTS BLOCK in `repo.config.ts`: the one place the traced
|
|
2
|
-
// audit (core/trace-audit.ts) writes the
|
|
2
|
+
// audit (core/trace-audit.ts) writes the paths each task reads outside its key.
|
|
3
3
|
//
|
|
4
4
|
// Its own markers, apart from the gate block (core/when-block.ts), so a repo
|
|
5
5
|
// that writes `off` or `tests` by hand, with its comments, keeps them exactly
|
|
@@ -7,7 +7,8 @@ export type AuditTask = {
|
|
|
7
7
|
/** `audited` when its trace had no hole, else why it could not be */
|
|
8
8
|
status: 'audited' | 'unaudited'
|
|
9
9
|
why?: string
|
|
10
|
-
/**
|
|
10
|
+
/** paths it read that its key does not cover: gitignored ones, and
|
|
11
|
+
* tracked files outside a declared list */
|
|
11
12
|
uncovered: string[]
|
|
12
13
|
/** the fewest `ignoredInputs` entries that cover them */
|
|
13
14
|
propose: string[]
|
|
@@ -37,7 +38,7 @@ export function pendingByTask(r: AuditReport | null, have: IgnoredInputs): Ignor
|
|
|
37
38
|
return out
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
/** `ignoredInputs`: task id →
|
|
41
|
+
/** `ignoredInputs`: task id → paths it reads outside its key, `'*'` for every task */
|
|
41
42
|
export type IgnoredInputs = Record<string, string[]>
|
|
42
43
|
|
|
43
44
|
/** the entries that join one task's key */
|
package/src/core/layout.ts
CHANGED
|
@@ -26,16 +26,16 @@ export const LAYOUT = {
|
|
|
26
26
|
// from. Tracked in a private repo only, since a board quotes the owner
|
|
27
27
|
plans: sk('plans'),
|
|
28
28
|
// the house repo's identities, who speaks: one folder each, its accounts; the house repo tracks it with its own
|
|
29
|
-
// gitignore line (wiki
|
|
29
|
+
// gitignore line (wiki tools/shipkit/social.md)
|
|
30
30
|
identities: sk('identities'),
|
|
31
31
|
// local: drafts, private notes, venue listings until they go live
|
|
32
32
|
private: sk('private'),
|
|
33
33
|
reflections: sk('reflections'),
|
|
34
34
|
// the social folder (contract v3): one folder a draft, the week's rhythm. The SK004 block re-includes it in a
|
|
35
|
-
// private repo only, like plans (wiki
|
|
35
|
+
// private repo only, like plans (wiki tools/shipkit/social.md)
|
|
36
36
|
social: sk('social'),
|
|
37
37
|
// local: the facts (sha, size, type) of every draft media, so a file the disk let go keeps its key in the media
|
|
38
|
-
// store (wiki
|
|
38
|
+
// store (wiki tools/shipkit/social.md, Media)
|
|
39
39
|
socialMedia: sk('social-media.json'),
|
|
40
40
|
journal: sk('journal'),
|
|
41
41
|
domain: sk('domain'),
|
package/src/core/loop-watch.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// already ended when the late beat fires, so the finished spans are kept too
|
|
5
5
|
export type Span = { what: string; at: number; end: number | null }
|
|
6
6
|
|
|
7
|
-
/** a stall shorter than this is the machine's ordinary jitter: the bar of wiki
|
|
7
|
+
/** a stall shorter than this is the machine's ordinary jitter: the bar of wiki tools/shipkit/home.md (Nothing heavy on the daemon's loop) */
|
|
8
8
|
export const STALL_MS = 200
|
|
9
9
|
const BEAT_MS = 250
|
|
10
10
|
const KEEP = 300
|
package/src/core/motherhome.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Report to the motherhome: a repo's row in the docsBase wiki's
|
|
2
|
-
// `
|
|
2
|
+
// `tools/shipkit/local-projects.md`, in two halves.
|
|
3
3
|
//
|
|
4
4
|
// - `reportToMotherhome` (every ci/check/init) files the row in the MACHINE
|
|
5
5
|
// DB and nothing else. A gate answers about its own repo, so it never
|
|
@@ -68,7 +68,7 @@ export function reportToMotherhome(root: string, config: RepoConfig, today: stri
|
|
|
68
68
|
// absolute local paths only: a relative docsBase would resolve
|
|
69
69
|
// against CWD, a URL is a display prefix
|
|
70
70
|
if (!base.startsWith('/')) return { wrote: false }
|
|
71
|
-
const page = join(base, '
|
|
71
|
+
const page = join(base, 'tools/shipkit/local-projects.md')
|
|
72
72
|
if (!existsSync(page)) return { wrote: false }
|
|
73
73
|
// a linked worktree is a temporary side checkout: its runs are
|
|
74
74
|
// covered when its branch merges
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ONE WAY IN, the harness half (
|
|
1
|
+
// ONE WAY IN, the harness half (tools/shipkit/one-way-in.md). The package.json half
|
|
2
2
|
// (rule SK001) routes `bun run test` into shipkit, but `bun test` is a bun
|
|
3
3
|
// BUILTIN: no script can intercept it, so a package.json alone leaves the
|
|
4
4
|
// reflex wide open. Claude Code permission rules can close it.
|
|
@@ -71,7 +71,7 @@ export const denyRules = (exemptSlots: Iterable<string> = []): string[] => {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// `git stash` in a tree that other agents share takes every agent's
|
|
74
|
-
// uncommitted work, not just the caller's (
|
|
74
|
+
// uncommitted work, not just the caller's (preferences/how-we-commit/index.md: never
|
|
75
75
|
// stash as a side effect). The deny row is the floor. Claude Code matches it
|
|
76
76
|
// per subcommand of a compound and inside `$(...)`, and never inside
|
|
77
77
|
// `bash -c '...'`, after git's own global options (`git -C dir stash`), or
|
|
@@ -174,7 +174,7 @@ export function stashCallIn(command: string, depth = 0): string | null {
|
|
|
174
174
|
|
|
175
175
|
/** what a stash refusal says: why, what to do instead, how to lift it */
|
|
176
176
|
export function stashRefusal(segment: string): string {
|
|
177
|
-
return `\`${segment.slice(0, 80)}\` stashes: in a tree that other agents share, a stash takes every agent's uncommitted work, not just yours. Set your own work aside with a commit by pathspec (git commit -m … -- <paths>), and read an existing stash by revision: \`git log -g --oneline refs/stash\`, \`git show stash@{0}:<file>\`. Reading a stash (\`git stash list\`, \`git stash show\`) is never refused. SK013 writes these rows in every shipkit repo (
|
|
177
|
+
return `\`${segment.slice(0, 80)}\` stashes: in a tree that other agents share, a stash takes every agent's uncommitted work, not just yours. Set your own work aside with a commit by pathspec (git commit -m … -- <paths>), and read an existing stash by revision: \`git log -g --oneline refs/stash\`, \`git show stash@{0}:<file>\`. Reading a stash (\`git stash list\`, \`git stash show\`) is never refused. SK013 writes these rows in every shipkit repo (preferences/how-we-commit/index.md): lifting them is a change to that rule, not a settings edit.`
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/** what a refusal says. Never just the ban: a refusal with no replacement
|
|
@@ -185,7 +185,7 @@ export function stashRefusal(segment: string): string {
|
|
|
185
185
|
export function refusal(r: RawRunner, segment?: string): string {
|
|
186
186
|
const alt = r.also == null ? '' : `, or ${r.also}`
|
|
187
187
|
const which = segment == null || segment.trim() === '' || segment.trim() === r.head ? '' : ` (refused on \`${segment.trim().slice(0, 80)}\`)`
|
|
188
|
-
return `\`${r.head}\`${which} ${r.why}. Use \`${r.use}\`${alt}. Lifting this for good: delete the "Bash(${r.head}*)" line from .claude/settings.json permissions.deny (
|
|
188
|
+
return `\`${r.head}\`${which} ${r.why}. Use \`${r.use}\`${alt}. Lifting this for good: delete the "Bash(${r.head}*)" line from .claude/settings.json permissions.deny (tools/shipkit/one-way-in.md).`
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/** shell wrappers that do not change what is being run */
|
|
@@ -276,13 +276,13 @@ function programWords(seg: string): string[] {
|
|
|
276
276
|
return s.split(/\s+/).filter((w) => w !== '')
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
/** true when the words run a GATE: `shipkit ci
|
|
279
|
+
/** true when the words run a GATE: `shipkit ci` or `sk ci` (one cli, two names), the cli by path
|
|
280
280
|
* (`bun <dir>/cli.ts ci`), or the `test` and `ci` package scripts. One suite
|
|
281
281
|
* while iterating (`bun run test:raw <file>`) is not a gate */
|
|
282
282
|
function isGate(words: string[]): boolean {
|
|
283
283
|
const [a, b, c] = words.map((w) => w.split('/').pop() ?? w)
|
|
284
|
-
if (a === 'shipkit') return b === 'ci'
|
|
285
|
-
if ((a === 'bunx' || a === 'npx') && b === 'shipkit') return c === 'ci'
|
|
284
|
+
if (a === 'shipkit' || a === 'sk') return b === 'ci'
|
|
285
|
+
if ((a === 'bunx' || a === 'npx') && (b === 'shipkit' || b === 'sk')) return c === 'ci'
|
|
286
286
|
if (a === 'cli.ts') return b === 'ci'
|
|
287
287
|
if (a === 'bun' || a === 'node') {
|
|
288
288
|
if (b === 'cli.ts') return c === 'ci'
|
|
@@ -309,7 +309,7 @@ export function pipedGateIn(command: string): string | null {
|
|
|
309
309
|
|
|
310
310
|
/** what a piped gate refusal says: why, what to type instead, how to lift it */
|
|
311
311
|
export function pipedGateRefusal(segment: string): string {
|
|
312
|
-
return `\`${segment.slice(0, 80)}\` pipes a gate: a pipeline exits with its LAST command's code, so a red gate reads green. Run the gate bare (a \`> file\` redirect keeps its exit code and is fine), then read its output in a separate call. Lifting this: put \`set -o pipefail;\` first, or remove the one-way-in-guard hook from .claude/settings.json
|
|
312
|
+
return `\`${segment.slice(0, 80)}\` pipes a gate: a pipeline exits with its LAST command's code, so a red gate reads green. Run the gate bare (a \`> file\` redirect keeps its exit code and is fine), then read its output in a separate call. Lifting this: put \`set -o pipefail;\` first, or remove the one-way-in-guard hook from .claude/settings.json.`
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
/** the raw runner this shell command reaches for, plus the segment that
|
package/src/core/run-ci.ts
CHANGED
|
@@ -182,8 +182,8 @@ export async function runCi(root: string, o: CiOpts = {}): Promise<number> {
|
|
|
182
182
|
// rather than leaving it with `unknown check id` and no next move
|
|
183
183
|
if ((o.onlyIds ?? []).includes(u.id))
|
|
184
184
|
sink(u.id === 'lint'
|
|
185
|
-
? ` fix: add a [lint] section to bunfig.toml, then \`shipkit ci --only lint\` runs \`bun lint\` (
|
|
186
|
-
: ` fix: add a '${u.id}:raw' script holding the tool, then \`shipkit ci --only ${u.id}\` runs it (
|
|
185
|
+
? ` fix: add a [lint] section to bunfig.toml, then \`shipkit ci --only lint\` runs \`bun lint\` (patterns/typescript/index.md)`
|
|
186
|
+
: ` fix: add a '${u.id}:raw' script holding the tool, then \`shipkit ci --only ${u.id}\` runs it (patterns/rv-conventions/package-json.md)`)
|
|
187
187
|
}
|
|
188
188
|
// the run record: one run id for every check of this gate, so a breakdown
|
|
189
189
|
// of the wall time is reconstructable. It is never read here, only written
|
|
@@ -235,7 +235,7 @@ export async function runCi(root: string, o: CiOpts = {}): Promise<number> {
|
|
|
235
235
|
})
|
|
236
236
|
const reg = ledger.layer.registration
|
|
237
237
|
for (const e of reg.errors) { registrationFailed = true; sink(`FAIL: ${e}`) }
|
|
238
|
-
if (registrationFailed) sink(' fix: each check declares one cache that its body can honour: files, reads, ttl, fact or never (
|
|
238
|
+
if (registrationFailed) sink(' fix: each check declares one cache that its body can honour: files, reads, ttl, fact or never (tools/shipkit/runs.md)')
|
|
239
239
|
// both counts, always. Printing only the burn-down made `never:` the
|
|
240
240
|
// cheap way to shrink the visible number, and that field carries no
|
|
241
241
|
// verification at all: a growing decided population has to be as
|
package/src/core/runs-matrix.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const MATRIX_AXES: readonly MatrixAxis[] = [...RUNS_KEYS, 'fix']
|
|
|
15
15
|
/** one axis of the legend: the command or event it is, and every value */
|
|
16
16
|
export type LegendAxis = { axis: MatrixAxis | 'cache'; short: string; context: string; values: { value: string; means: string }[] }
|
|
17
17
|
|
|
18
|
-
/** THE legend. Every surface prints it verbatim, and
|
|
18
|
+
/** THE legend. Every surface prints it verbatim, and tools/shipkit/runs.md is
|
|
19
19
|
* generated from it */
|
|
20
20
|
export const RUNS_LEGEND: readonly LegendAxis[] = [
|
|
21
21
|
{
|