rvlib-shipkit 0.38.0 → 1.0.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 +371 -16
- package/README.md +26 -14
- package/package.json +2 -2
- package/src/assets/gen/comfyts-gen.ts +27 -10
- package/src/assets/gen/generate-roll.ts +1 -1
- package/src/assets/kit-config.ts +6 -6
- package/src/assets/run-assets.ts +14 -10
- package/src/assets/server/studio-server.ts +6 -5
- package/src/check.ts +343 -0
- package/src/{rules/SK001-package-json-shape.ts → checks/SK001-package-json-shape.check.ts} +44 -46
- package/src/checks/SK002-contracts-fulfillness.check.ts +24 -0
- package/src/checks/SK003-claude-md-shape.check.ts +66 -0
- package/src/checks/SK004-gitignore-policy.check.ts +309 -0
- package/src/{rules/SK005-rvlib-versions.ts → checks/SK005-rvlib-versions.check.ts} +46 -32
- package/src/{rules/SK006-npm-publish-safety.ts → checks/SK006-npm-publish-safety.check.ts} +25 -24
- package/src/{rules/SK007-github-visibility.ts → checks/SK007-github-visibility.check.ts} +20 -14
- package/src/{rules/SK008-reviewer-agent.ts → checks/SK008-reviewer-agent.check.ts} +29 -14
- package/src/{rules/SK009-commit-ai-tells.ts → checks/SK009-commit-ai-tells.check.ts} +24 -21
- package/src/checks/SK010-undeclared-unit.check.ts +111 -0
- package/src/{rules/SK011-sibling-unit-ranges.ts → checks/SK011-sibling-unit-ranges.check.ts} +21 -20
- package/src/{rules/SK012-config-barrel-import.ts → checks/SK012-config-barrel-import.check.ts} +18 -23
- package/src/{rules/SK013-one-way-in-policy.ts → checks/SK013-one-way-in-policy.check.ts} +58 -50
- package/src/{rules/SK014-prose-ste.ts → checks/SK014-prose-ste.check.ts} +27 -13
- package/src/{rules/SK015-nested-repo.ts → checks/SK015-nested-repo.check.ts} +15 -12
- package/src/checks/SK016-legacy-check-shapes.check.ts +182 -0
- package/src/checks/SK017-vscode-hub-task.check.ts +197 -0
- package/src/checks/SK018-test-files-run.check.ts +28 -0
- package/src/checks/SK019-tests-run-in-units.check.ts +76 -0
- package/src/checks/SK020-self-spawning-check.check.ts +147 -0
- package/src/checks/contracts.check.ts +20 -0
- package/src/cli/cmd_Asks.ts +3 -2
- package/src/cli/cmd_Assets.ts +2 -2
- package/src/cli/cmd_Bump.ts +1 -1
- package/src/cli/cmd_Check.ts +6 -6
- package/src/cli/cmd_Checks.ts +95 -0
- package/src/cli/cmd_Ci.ts +48 -13
- package/src/cli/cmd_Commands.ts +2 -6
- package/src/cli/cmd_ConfigKeys.ts +69 -0
- package/src/cli/cmd_Contracts.ts +1 -1
- package/src/cli/cmd_Fleet.ts +6 -2
- package/src/cli/cmd_Hooks.ts +1 -1
- package/src/cli/cmd_Keys.ts +43 -18
- package/src/cli/cmd_Mv.ts +2 -2
- package/src/cli/cmd_Prose.ts +10 -1
- package/src/cli/cmd_Releases.ts +2 -2
- package/src/cli/cmd_Serve.ts +1 -1
- package/src/cli/cmd_Start.ts +6 -6
- package/src/cli/cmd_Status.ts +25 -0
- package/src/cli/cmd_Tui.ts +2 -2
- package/src/cli.ts +7 -4
- package/src/collections/actions.ts +4 -4
- package/src/collections/checks.ts +258 -0
- package/src/collections/collection-types.ts +254 -1
- package/src/collections/comfy.ts +23 -0
- package/src/collections/md-body.ts +14 -0
- package/src/collections/pings.ts +38 -12
- package/src/collections/posts.ts +19 -3
- package/src/collections/providers.ts +198 -91
- package/src/collections/reflections.ts +41 -0
- package/src/collections/state-rules.ts +73 -0
- package/src/collections/test-time.ts +288 -0
- package/src/collections/tests.ts +181 -0
- package/src/collections/wikis.ts +66 -0
- package/src/comfy/comfy-panel.ts +292 -0
- package/src/contracts/apply-contracts.ts +17 -12
- package/src/contracts/contract-types.ts +16 -4
- package/src/contracts/contracts-engine.ts +78 -42
- package/src/contracts/manifests/discord.contract.ts +6 -6
- package/src/contracts/manifests/identity.contract.ts +3 -3
- package/src/contracts/manifests/itch.contract.ts +12 -15
- package/src/contracts/manifests/social.contract.ts +5 -5
- package/src/contracts/manifests/steam.contract.ts +16 -16
- package/src/contracts/run-contracts.ts +4 -3
- package/src/core/attach.ts +96 -0
- package/src/core/canonical-scripts.ts +25 -0
- package/src/core/check-ctx.ts +204 -14
- package/src/core/check-file-names.ts +112 -0
- package/src/core/check-pass.ts +84 -0
- package/src/core/check-runner.ts +796 -0
- package/src/core/config-keys.ts +256 -0
- package/src/core/config-rewrite.ts +77 -0
- package/src/core/discover-checks.ts +166 -90
- package/src/core/discover-legacy-checks.ts +26 -0
- package/src/core/doc-block.ts +13 -0
- package/src/core/floor-resolve.ts +264 -0
- package/src/core/floor.ts +20 -137
- package/src/core/git-bin.ts +24 -0
- package/src/core/git-root.ts +108 -0
- package/src/core/instance.ts +195 -0
- package/src/core/jobs.ts +118 -0
- package/src/core/layout.ts +52 -0
- package/src/core/legacy-shapes.ts +207 -0
- package/src/core/lib-root.ts +5 -0
- package/src/core/locked-write.ts +110 -39
- package/src/core/machine-commit.ts +5 -4
- package/src/core/migrate-layout.ts +557 -0
- package/src/core/motherhome.ts +2 -8
- package/src/core/nesting.ts +4 -12
- package/src/core/one-way-in-policy.ts +73 -17
- package/src/core/outcome-words.ts +45 -0
- package/src/core/package-manager.ts +86 -0
- package/src/core/parallel.ts +21 -0
- package/src/core/process-tree.ts +44 -0
- package/src/core/raw-access.ts +93 -0
- package/src/core/read-set.ts +152 -0
- package/src/core/run-check.ts +155 -213
- package/src/core/run-ci.ts +153 -189
- package/src/core/run-fix.ts +96 -0
- package/src/core/run-fixers.ts +53 -30
- package/src/core/self-update.ts +9 -3
- package/src/core/slots.ts +83 -0
- package/src/core/spawn-timeout.ts +34 -3
- package/src/core/when-block.ts +401 -0
- package/src/core/when.ts +135 -0
- package/src/core/write-status.ts +5 -2
- package/src/hooks/leak-guard.ts +10 -8
- package/src/hooks/one-way-in-guard.ts +13 -5
- package/src/hooks/root-identity.ts +2 -1
- package/src/hooks/run-hooks.ts +35 -23
- package/src/init-repo.ts +39 -23
- package/src/ledger/check-stats.ts +155 -0
- package/src/ledger/check-table.ts +179 -0
- package/src/ledger/db.ts +255 -0
- package/src/ledger/gate-checks.ts +433 -0
- package/src/ledger/git-key.ts +116 -77
- package/src/ledger/git-scan.ts +96 -35
- package/src/ledger/ledger.ts +116 -42
- package/src/ledger/live-runs.ts +111 -0
- package/src/ledger/live-timeline.ts +97 -0
- package/src/ledger/repo-view.ts +73 -0
- package/src/ledger/run-log.ts +448 -0
- package/src/ledger/run-timeline.ts +173 -0
- package/src/ledger/store.ts +23 -12
- package/src/ledger/suite-log.ts +161 -0
- package/src/ledger/toolchain-identity.ts +7 -1
- package/src/ledger/world-cache.ts +111 -0
- package/src/mv/mv-md.ts +16 -6
- package/src/problems/extract.ts +182 -0
- package/src/problems/problem-board.ts +37 -0
- package/src/problems/problem-line.ts +77 -0
- package/src/prose/prose-view.ts +90 -0
- package/src/prose/run-prose.ts +60 -19
- package/src/prose/ste.ts +140 -24
- package/src/reflections/reflections-queue.ts +81 -0
- package/src/release/git-facts.ts +15 -9
- package/src/release/run-bump.ts +6 -5
- package/src/release/run-release.ts +25 -11
- package/src/release/run-releases.ts +2 -2
- package/src/release/unit-gate.ts +7 -54
- package/src/release/unit-resolve.ts +282 -0
- package/src/release/units.ts +33 -217
- package/src/repo-config.ts +155 -85
- package/src/rules/rule.ts +36 -96
- package/src/rules/untrack-generated.ts +5 -4
- package/src/scaffold/files/vscode-tasks.json +10 -31
- package/src/scaffold/jsonc-spans.ts +113 -0
- package/src/scaffold/project-scaffold.ts +16 -43
- package/src/scan.ts +98 -0
- package/src/serve/gate-trigger.ts +148 -0
- package/src/serve/health-schedule.ts +102 -0
- package/src/serve/hub-app/chart-view.ts +179 -0
- package/src/serve/hub-app/check-view.tsx +345 -0
- package/src/serve/hub-app/check-words.ts +164 -0
- package/src/serve/hub-app/checks-svc.ts +280 -0
- package/src/serve/hub-app/clock-svc.ts +33 -0
- package/src/serve/hub-app/col-card.tsx +23 -39
- package/src/serve/hub-app/cols-svc.ts +44 -20
- package/src/serve/hub-app/comfy-svc.ts +171 -0
- package/src/serve/hub-app/comfy-view.tsx +81 -0
- package/src/serve/hub-app/dur.ts +41 -0
- package/src/serve/hub-app/hash-route.ts +121 -0
- package/src/serve/hub-app/header-bar.tsx +117 -0
- package/src/serve/hub-app/health-svc.ts +23 -28
- package/src/serve/hub-app/help.tsx +29 -0
- package/src/serve/hub-app/hub-app.tsx +122 -119
- package/src/serve/hub-app/hub-st.ts +115 -42
- package/src/serve/hub-app/hub-types.ts +117 -2
- package/src/serve/hub-app/hub.css +534 -192
- package/src/serve/hub-app/index.html +2 -0
- package/src/serve/hub-app/live-svc.ts +174 -0
- package/src/serve/hub-app/md.ts +15 -0
- package/src/serve/hub-app/media-svc.ts +4 -1
- package/src/serve/hub-app/media-view.tsx +15 -0
- package/src/serve/hub-app/next-run.ts +68 -0
- package/src/serve/hub-app/project-gutter.css +65 -0
- package/src/serve/hub-app/project-gutter.tsx +128 -0
- package/src/serve/hub-app/projects-svc.ts +226 -0
- package/src/serve/hub-app/prose-hits-st.ts +124 -0
- package/src/serve/hub-app/prose-hits-view.tsx +176 -0
- package/src/serve/hub-app/prose-hits.css +21 -0
- package/src/serve/hub-app/run-strip.ts +47 -0
- package/src/serve/hub-app/runs-tabs.ts +24 -0
- package/src/serve/hub-app/test-view.tsx +107 -0
- package/src/serve/hub-app/tests-svc.ts +62 -0
- package/src/serve/hub-app/tests-view.tsx +238 -0
- package/src/serve/hub-app/time-ago.tsx +34 -0
- package/src/serve/hub-app/timeline-chart.tsx +274 -0
- package/src/serve/hub-app/timeline-geometry.ts +314 -0
- package/src/serve/hub-app/timeline-svc.ts +62 -0
- package/src/serve/hub-app/timeline-view.tsx +245 -0
- package/src/serve/hub-app/tree-build.ts +410 -0
- package/src/serve/hub-app/tree-row.tsx +42 -0
- package/src/serve/hub-app/tree-svc.ts +174 -0
- package/src/serve/hub-app/wikis-view.tsx +53 -0
- package/src/serve/other-repos.ts +79 -0
- package/src/serve/project-gutter-route.ts +350 -0
- package/src/serve/project-gutter.ts +449 -0
- package/src/serve/run-serve.ts +245 -16
- package/src/serve/same-origin.ts +14 -0
- package/src/serve/serve-hub.ts +213 -18
- package/src/shipkit.ts +19 -12
- package/src/smoke/run-smoke.ts +3 -2
- package/src/start-repo.ts +75 -36
- package/src/suite/judge-suites.ts +216 -18
- package/src/suite/kept-timings.ts +58 -0
- package/src/suite/runner-shapes.ts +88 -0
- package/src/suite/suite-cli.ts +147 -24
- package/src/suite/suite-cpu-preload.ts +92 -0
- package/src/suite/test-units.ts +243 -0
- package/src/ts/config.ts +4 -69
- package/src/ts/jsonc.ts +69 -0
- package/src/ts/lex.ts +143 -0
- package/src/ts/rename.ts +73 -10
- package/src/ts/source-graph.ts +28 -8
- package/src/ts/tsconfig-projects.ts +6 -97
- package/src/ts/tsconfig-resolve.ts +108 -0
- package/src/tui/build-steps-panel.ts +61 -0
- package/src/tui/checks-panel.ts +24 -16
- package/src/tui/run-tui.ts +2 -2
- package/src/tui/tui-panel.ts +5 -4
- package/src/wiki/graph-colors.ts +68 -0
- package/src/wiki/graph-mount.ts +7 -9
- package/src/wiki/graph-page.ts +42 -25
- package/src/wiki/graph-positions.ts +105 -0
- package/src/wiki/run-wiki.ts +1 -1
- package/src/wiki/serve-graph.ts +33 -3
- package/src/cli/cmd_Rules.ts +0 -51
- package/src/cli/cmd_Units.ts +0 -82
- package/src/collections/graphs.ts +0 -32
- package/src/contracts/contracts-once.ts +0 -43
- package/src/core/check-suite.ts +0 -302
- package/src/core/repair-contract-dirs.ts +0 -136
- package/src/core/task-runner.ts +0 -339
- package/src/ledger/gate-units.ts +0 -138
- package/src/ledger/unit-table.ts +0 -105
- package/src/rules/SK002-contracts-fulfillness.ts +0 -24
- package/src/rules/SK003-claude-md-shape.ts +0 -70
- package/src/rules/SK004-gitignore-policy.ts +0 -238
- package/src/rules/SK010-undeclared-release-unit.ts +0 -127
- package/src/rules/rule-registry.ts +0 -64
- package/src/rules/run-fix.ts +0 -72
- package/src/tui/tasks-panel.ts +0 -60
package/src/rules/run-fix.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// `shipkit check --fix [SK### …]` — apply rule autofixes, then re-lint and
|
|
2
|
-
// show the real end state. Never runs under ci (the gate stays pure), never
|
|
3
|
-
// caches (a fixer must see reality). No ids = every fixable rule; a
|
|
4
|
-
// requested id that is unknown or unfixable fails loud instead of silently
|
|
5
|
-
// narrowing.
|
|
6
|
-
import { CheckCtx } from '../core/check-ctx.ts'
|
|
7
|
-
import { formatLine } from '../core/wire.ts'
|
|
8
|
-
import { loadRepoConfig } from '../repo-config.ts'
|
|
9
|
-
import { RULES } from './rule-registry.ts'
|
|
10
|
-
import { runRuleLint, type RuleEnv } from './rule.ts'
|
|
11
|
-
|
|
12
|
-
export type FixOpts = {
|
|
13
|
-
ids?: string[]
|
|
14
|
-
/** drop the closing advisory: inside the ci fix pass it is noise, and it is
|
|
15
|
-
* not wire-shaped, which the frozen output contract forbids */
|
|
16
|
-
quiet?: boolean
|
|
17
|
-
print?: (line: string) => void
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function runFix(root: string, o: FixOpts = {}): Promise<number> {
|
|
21
|
-
const print = o.print ?? ((l: string) => console.log(l))
|
|
22
|
-
const config = await loadRepoConfig(root)
|
|
23
|
-
const env: RuleEnv = { root, config }
|
|
24
|
-
const color = process.stdout.isTTY && process.env.NO_COLOR == null
|
|
25
|
-
// the repo's own rules fix exactly like the built-ins, one code path
|
|
26
|
-
const all = [...RULES, ...(config.rules ?? [])]
|
|
27
|
-
|
|
28
|
-
let targets = all.filter((r) => r.fix != null)
|
|
29
|
-
if (o.ids != null && o.ids.length > 0) {
|
|
30
|
-
for (const id of o.ids) {
|
|
31
|
-
const r = all.find((x) => x.id === id)
|
|
32
|
-
if (r == null) { print(`FAIL: unknown rule '${id}' — see: shipkit rules`); return 1 }
|
|
33
|
-
if (r.fix == null) { print(`FAIL: [${id}] has no autofix — fix by hand: ${config.docsBase ?? ''}${r.owner}`); return 1 }
|
|
34
|
-
}
|
|
35
|
-
const wanted = new Set(o.ids)
|
|
36
|
-
targets = targets.filter((r) => wanted.has(r.id))
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let exit = 0
|
|
40
|
-
for (const rule of targets) {
|
|
41
|
-
const before = new CheckCtx(new Map())
|
|
42
|
-
await runRuleLint(rule, before, env)
|
|
43
|
-
// an exempted rule never autofixes: the repo broke that invariant on purpose
|
|
44
|
-
const exempt = config.ruleExempt?.[rule.id]
|
|
45
|
-
if (exempt != null) {
|
|
46
|
-
if (o.quiet !== true) print(`skip: [${rule.id}] ${rule.id} exempt: ${exempt}`)
|
|
47
|
-
continue
|
|
48
|
-
}
|
|
49
|
-
if (!before.failed && !before.warned) {
|
|
50
|
-
// inside the ci fix pass, a line per already-clean rule is a wall of
|
|
51
|
-
// nothing above the run that reports those same rules for real
|
|
52
|
-
if (o.quiet !== true) print(`ok: [${rule.id}] already clean — nothing to fix`)
|
|
53
|
-
continue
|
|
54
|
-
}
|
|
55
|
-
const f = await rule.fix!(env)
|
|
56
|
-
// an unchanged fix is the DESIGNED outcome for judgment findings, so
|
|
57
|
-
// it is an ok, not a warning. It carries a frozen wire prefix like
|
|
58
|
-
// every other line the fix pass emits: `shipkit ci` promises its whole
|
|
59
|
-
// output is parseable, and a bare line breaks that for every reader.
|
|
60
|
-
print(f.changed ? `ok: [${rule.id}] fixed: ${f.summary}` : `ok: [${rule.id}] fix changed nothing — ${f.summary}`)
|
|
61
|
-
const after = new CheckCtx(new Map())
|
|
62
|
-
await runRuleLint(rule, after, env)
|
|
63
|
-
// the fix already ran: advertising it again on surviving findings
|
|
64
|
-
// would send an agent in a loop
|
|
65
|
-
for (const l of after.lines) print(formatLine({ ...l, text: l.text.replace(/ · autofix: shipkit check --fix [A-Z]{2,4}\d{3}$/, '') }, color))
|
|
66
|
-
if (after.failed) exit = 1
|
|
67
|
-
}
|
|
68
|
-
const unfixable = all.filter((r) => r.fix == null).length
|
|
69
|
-
if (unfixable > 0 && o.quiet !== true && (o.ids == null || o.ids.length === 0))
|
|
70
|
-
print(`${unfixable} rule(s) have no autofix — they report in the run below`)
|
|
71
|
-
return exit
|
|
72
|
-
}
|
package/src/tui/tasks-panel.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// built-in panel: the ci gate's TASKS (floor + contracts + repo tasks)
|
|
2
|
-
// through runCi — results stream in via the onTaskFinish tap. The checks are
|
|
3
|
-
// skipped here on purpose: the Checks panel runs the same suite and renders
|
|
4
|
-
// it, and running it twice per refresh costs twice and proves the same thing.
|
|
5
|
-
// no panel writes STATUS.md: a dashboard refresh runs the tasks alone, so
|
|
6
|
-
// stamping a verdict from it would overwrite what a real gate proved with a
|
|
7
|
-
// narrower claim, just by looking at the repo.
|
|
8
|
-
import type { RepoConfig } from '../repo-config.ts'
|
|
9
|
-
import { allTasks } from '../repo-config.ts'
|
|
10
|
-
import { runCi } from '../core/run-ci.ts'
|
|
11
|
-
import { formatLine } from '../core/wire.ts'
|
|
12
|
-
import type { TaskResult } from '../core/task-runner.ts'
|
|
13
|
-
import type { TuiPanelDef, TuiRow } from './tui-panel.ts'
|
|
14
|
-
|
|
15
|
-
const taskRow = (r: TaskResult): TuiRow => ({
|
|
16
|
-
key: r.id,
|
|
17
|
-
label: r.id,
|
|
18
|
-
status: r.status === 'pass' ? (r.lines.some((l) => l.kind === 'warn') ? 'warn' : 'pass') : r.status === 'fail' ? 'fail' : 'skip',
|
|
19
|
-
hint: `${(r.durationMs / 1000).toFixed(1)}s`,
|
|
20
|
-
detail: [
|
|
21
|
-
...r.lines.map((l) => formatLine(l, false)),
|
|
22
|
-
...(r.status === 'fail' && r.lastLine !== '' ? [`FAIL: ${r.lastLine}`] : []),
|
|
23
|
-
...(r.note !== '' ? [`skip: ${r.note}`] : []),
|
|
24
|
-
...(r.logPath != null ? [`full log: ${r.logPath}`] : []),
|
|
25
|
-
],
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export function tasksPanel(root: string, config: RepoConfig): TuiPanelDef {
|
|
29
|
-
let rows: TuiRow[] = []
|
|
30
|
-
return {
|
|
31
|
-
id: 'tasks',
|
|
32
|
-
title: 'Tasks',
|
|
33
|
-
rows: () => rows,
|
|
34
|
-
refresh: async (update) => {
|
|
35
|
-
const { tasks, disabled, unfilled } = allTasks(config, root)
|
|
36
|
-
rows = [
|
|
37
|
-
...tasks.map((t): TuiRow => ({ key: t.id, label: t.id, status: 'pending', detail: [] })),
|
|
38
|
-
...disabled.map((id): TuiRow => ({ key: id, label: id, status: 'skip', detail: ['skip: disabled by repo.config defaults'] })),
|
|
39
|
-
...unfilled.map((u): TuiRow => ({ key: u.id, label: u.id, status: 'skip', detail: [`skip: ${u.reason}`] })),
|
|
40
|
-
]
|
|
41
|
-
const byKey = new Map(rows.map((r, i) => [r.key, i]))
|
|
42
|
-
update()
|
|
43
|
-
await runCi(root, {
|
|
44
|
-
config,
|
|
45
|
-
skipChecks: true,
|
|
46
|
-
status: false,
|
|
47
|
-
print: () => {}, // rows carry everything the wire lines would
|
|
48
|
-
onTaskFinish: (r) => {
|
|
49
|
-
const i = byKey.get(r.id)
|
|
50
|
-
if (i == null) return
|
|
51
|
-
rows[i] = taskRow(r)
|
|
52
|
-
update()
|
|
53
|
-
},
|
|
54
|
-
})
|
|
55
|
-
// bail/interrupt leftovers never got a finish tap — visible, never a fake pass
|
|
56
|
-
rows = rows.map((r) => (r.status === 'pending' ? { ...r, status: 'skip', detail: ['skip: never ran (bailed or interrupted)'] } : r))
|
|
57
|
-
update()
|
|
58
|
-
},
|
|
59
|
-
}
|
|
60
|
-
}
|