@1aboveio/engineering-skills 0.1.8 → 0.1.10
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/package.json +2 -2
- package/skills/better-review/SKILL.md +1 -1
- package/skills/better-review/release-check.mjs +3 -1
- package/skills/contributing/SKILL.md +1 -1
- package/skills/contributing/release-check.mjs +3 -1
- package/skills/e2e-test/SKILL.md +1 -1
- package/skills/e2e-test/release-check.mjs +3 -1
- package/skills/engineering-runtime/SKILL.md +1 -1
- package/skills/engineering-runtime/coherence/workflow.json +13 -13
- package/skills/engineering-runtime/release-check.mjs +3 -1
- package/skills/engineering-runtime/scripts/installation-resolver.mjs +191 -0
- package/skills/engineering-runtime/scripts/workflow-coherence.mjs +51 -10
- package/skills/ensure-coverage/SKILL.md +1 -1
- package/skills/ensure-coverage/release-check.mjs +3 -1
- package/skills/golden-path/SKILL.md +1 -1
- package/skills/golden-path/release-check.mjs +3 -1
- package/skills/harness-runtime/SKILL.md +1 -1
- package/skills/harness-runtime/release-check.mjs +3 -1
- package/skills/resolve-issues/SKILL.md +1 -1
- package/skills/resolve-issues/references/preflight.md +7 -0
- package/skills/resolve-issues/references/shared-modules.md +27 -0
- package/skills/resolve-issues/references/task-plan.md +5 -1
- package/skills/resolve-issues/release-check.mjs +3 -1
- package/skills/resolve-issues/scripts/active-installation.mjs +32 -0
- package/skills/resolve-issues/scripts/install-hooks.mjs +3 -0
- package/skills/resolve-issues/scripts/rehydrate.mjs +17 -1
- package/skills/resolve-release/SKILL.md +1 -1
- package/skills/resolve-release/release-check.mjs +3 -1
- package/skills/rush-issues/SKILL.md +1 -1
- package/skills/rush-issues/release-check.mjs +3 -1
- package/skills/rush-release/SKILL.md +1 -1
- package/skills/rush-release/release-check.mjs +3 -1
- package/skills/test-quality/SKILL.md +1 -1
- package/skills/test-quality/release-check.mjs +3 -1
- package/skills/better-review/scripts/pr-context.test.mjs +0 -168
- package/skills/better-review/scripts/rereview-scope.test.mjs +0 -587
- package/skills/better-review/scripts/scan-diff.test.mjs +0 -414
- package/skills/better-review/scripts/vendor-sync.test.mjs +0 -96
- package/skills/contributing/scripts/persist-conventions.test.mjs +0 -118
- package/skills/e2e-test/scripts/presentation-checks.test.mjs +0 -106
- package/skills/e2e-test/scripts/presentation-perceivability.test.mjs +0 -117
- package/skills/e2e-test/scripts/presentation-reachability.test.mjs +0 -69
- package/skills/e2e-test/scripts/presentation-render-health.test.mjs +0 -98
- package/skills/e2e-test/scripts/presentation-sweep.test.mjs +0 -71
- package/skills/e2e-test/scripts/presentation-temporal.test.mjs +0 -59
- package/skills/e2e-test/scripts/project-route-manifest.test.mjs +0 -76
- package/skills/engineering-runtime/engineering-runtime.test.mjs +0 -68
- package/skills/engineering-runtime/scripts/invocation-policy.test.mjs +0 -95
- package/skills/engineering-runtime/scripts/main-module.test.mjs +0 -288
- package/skills/engineering-runtime/scripts/required-check-plan.test.mjs +0 -96
- package/skills/ensure-coverage/scripts/adapters/nextjs-inventory.test.mjs +0 -96
- package/skills/ensure-coverage/scripts/check-quarantine-expiry.test.mjs +0 -47
- package/skills/ensure-coverage/scripts/ci-audit.test.mjs +0 -86
- package/skills/ensure-coverage/scripts/coverage-ledger.test.mjs +0 -447
- package/skills/ensure-coverage/scripts/design-parity.test.mjs +0 -552
- package/skills/ensure-coverage/scripts/lint-tests.test.mjs +0 -289
- package/skills/ensure-coverage/scripts/mock-policy-config.test.mjs +0 -119
- package/skills/golden-path/scripts/golden-path.test.mjs +0 -1457
- package/skills/harness-runtime/discover-models.test.mjs +0 -363
- package/skills/harness-runtime/harness-runtime.test.mjs +0 -967
- package/skills/harness-runtime/model-catalog-seed.test.mjs +0 -829
- package/skills/harness-runtime/model-catalog.test.mjs +0 -366
- package/skills/resolve-issues/scripts/cleanup-runs.test.mjs +0 -280
- package/skills/resolve-issues/scripts/dropbox.test.mjs +0 -346
- package/skills/resolve-issues/scripts/findings-reuse.test.mjs +0 -88
- package/skills/resolve-issues/scripts/github-reviews.test.mjs +0 -264
- package/skills/resolve-issues/scripts/install-hooks.test.mjs +0 -79
- package/skills/resolve-issues/scripts/issue-tree.test.mjs +0 -107
- package/skills/resolve-issues/scripts/manual-invocation.test.mjs +0 -14
- package/skills/resolve-issues/scripts/next-actions-capacity.test.mjs +0 -149
- package/skills/resolve-issues/scripts/next-actions.test.mjs +0 -915
- package/skills/resolve-issues/scripts/plan-sync.test.mjs +0 -156
- package/skills/resolve-issues/scripts/preflight-models.test.mjs +0 -448
- package/skills/resolve-issues/scripts/ready-check.test.mjs +0 -217
- package/skills/resolve-issues/scripts/rehydrate.test.mjs +0 -91
- package/skills/resolve-issues/scripts/review-verdict.test.mjs +0 -1060
- package/skills/resolve-issues/scripts/size-check.test.mjs +0 -458
- package/skills/resolve-release/scripts/apply.test.mjs +0 -99
- package/skills/resolve-release/scripts/dark-flags.test.mjs +0 -100
- package/skills/resolve-release/scripts/flow.test.mjs +0 -340
- package/skills/resolve-release/scripts/green-head.test.mjs +0 -101
- package/skills/resolve-release/scripts/npm-version-absence.test.mjs +0 -426
- package/skills/resolve-release/scripts/plan-npm.test.mjs +0 -659
- package/skills/resolve-release/scripts/plan-toml-boundary.test.mjs +0 -317
- package/skills/resolve-release/scripts/plan-uv.test.mjs +0 -291
- package/skills/resolve-release/scripts/plan.test.mjs +0 -428
- package/skills/test-quality/scripts/lint-tests.test.mjs +0 -591
- package/skills/test-quality/scripts/mock-policy-config.test.mjs +0 -119
- package/skills/test-quality/scripts/persist-conventions.test.mjs +0 -104
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -45,6 +45,13 @@ sub-issues, never a checklist.
|
|
|
45
45
|
|
|
46
46
|
### Compaction hook
|
|
47
47
|
|
|
48
|
+
For a native Codex bundle, first follow [Native Codex selection](shared-modules.md#native-codex-selection).
|
|
49
|
+
The hook command returns `plugin-no-global-hooks` and writes nothing, even without
|
|
50
|
+
`--check`. Do not offer a machine-wide cached-path hook. Preserve the installation
|
|
51
|
+
descriptor in the plan and use the selected copy's recovery command after resume.
|
|
52
|
+
Native host compaction/resume still requires separate client certification.
|
|
53
|
+
The remaining hook instructions apply to standalone installations.
|
|
54
|
+
|
|
48
55
|
**A compaction summary keeps the run's state and drops the skill's rules, so
|
|
49
56
|
a hook makes you read the skills again after every compaction.** Check it:
|
|
50
57
|
|
|
@@ -4,6 +4,33 @@ Use the owning skill for models, review, golden paths, and the merge queue; neve
|
|
|
4
4
|
copy its doctrine here. Resolve a leaf skill from the active skills root only
|
|
5
5
|
for a stage that invokes it, and pass its absolute path.
|
|
6
6
|
|
|
7
|
+
## Native Codex selection
|
|
8
|
+
|
|
9
|
+
For a native bundle invocation, run the invoked copy's
|
|
10
|
+
`scripts/active-installation.mjs capture` before spawning workers. Save its JSON as
|
|
11
|
+
`installation` in this run's task plan and as a run-local `installation.json`.
|
|
12
|
+
Capture reads only the executing bundle's fixed ancestor, never another cache.
|
|
13
|
+
A certifier passes independently verified pins as `capture <expected-pins.json>`;
|
|
14
|
+
ordinary capture starts from the artifact selected by Codex. Neither operation is
|
|
15
|
+
a signature or published-artifact certification.
|
|
16
|
+
|
|
17
|
+
Use `scripts/active-installation.mjs worker <installation.json> <canonical-name>...`
|
|
18
|
+
to obtain verified absolute instruction paths. Resolve other resources through
|
|
19
|
+
`engineering-runtime/scripts/installation-resolver.mjs resolve <installation.json>
|
|
20
|
+
<canonical-name> <member-relative-resource>`. Pass those paths and the unchanged
|
|
21
|
+
installation descriptor in worker briefs. Keep the host's observed namespaced
|
|
22
|
+
identity separate from the canonical catalog name; never strip arbitrary prefixes
|
|
23
|
+
to resolve dependencies. Missing, changed or ambiguous resources stop the affected
|
|
24
|
+
workflow; do not search caches, use a shared namesake, or install dependencies.
|
|
25
|
+
Model slots and reviewer independence still follow the policy below.
|
|
26
|
+
|
|
27
|
+
After compaction or resume, run the selected copy's `scripts/rehydrate.mjs --cwd
|
|
28
|
+
<project>` and read the returned instruction paths in full. It verifies the saved
|
|
29
|
+
installation before returning paths and reports blocked recovery on drift. Native
|
|
30
|
+
bundle invocations do not install global hooks. Scripted recovery alone is not
|
|
31
|
+
proof that a Codex surface triggers it; native host compaction/resume certification
|
|
32
|
+
must pass before that surface is advertised as supported.
|
|
33
|
+
|
|
7
34
|
## Model catalog
|
|
8
35
|
|
|
9
36
|
Owner: [`harness-runtime`](../../harness-runtime/) (catalog doctrine and seed
|
|
@@ -102,7 +102,11 @@ Example: #1201's code is done and its PR is in review, so it is
|
|
|
102
102
|
merge-ready PR handed back stays `in-flight` with the note "merge-ready,
|
|
103
103
|
handed back"; it is never `succeeded` until the human merges it.
|
|
104
104
|
|
|
105
|
-
Run fields:
|
|
105
|
+
Run fields: optional `installation` holds the explicit native installation descriptor
|
|
106
|
+
(one absolute root, layout, resource metadata path/digest, release identity, and
|
|
107
|
+
pinned external root mappings). Capture from the selected bundle and preserve it
|
|
108
|
+
through workers and recovery; never replace it with a newer cache or shared copy.
|
|
109
|
+
Other run fields: `skill` (`resolve-issues` or `rush-issues`; the scheduler and
|
|
106
110
|
rehydrate read it, and `next-actions.mjs` exits 2 without it), `planRevision`, models and efforts, `targetBranch`,
|
|
107
111
|
`deliveryMode` and its check, `mergeMode`, run directory, `specLocator`
|
|
108
112
|
(`owner/name#N` or an issue URL; any other name turns off the issue-tree sync),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { executingBundleRoot, selectInstallation, workerResources } from '../../engineering-runtime/scripts/installation-resolver.mjs';
|
|
6
|
+
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs';
|
|
7
|
+
|
|
8
|
+
// Initial capture trusts the explicitly invoked native artifact's package metadata. A release
|
|
9
|
+
// certifier supplies independent pins; subsequent workers/recovery always reuse the captured pins.
|
|
10
|
+
export function captureBundleInstallation(skillDirectory, expected = null, externalRoots = {}) {
|
|
11
|
+
const root = executingBundleRoot(skillDirectory);
|
|
12
|
+
if (!root) throw new Error('The invoked skill is not in a native bundle');
|
|
13
|
+
const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
14
|
+
const pins = expected ?? pkg.nativeCodex;
|
|
15
|
+
if (!pins || Object.keys(pins).some((key) => !['schemaVersion', 'metadataPath', 'metadataDigest', 'releaseIdentity'].includes(key))) {
|
|
16
|
+
throw new Error('Expected resource pins cannot override installation selection');
|
|
17
|
+
}
|
|
18
|
+
const { metadataPath, metadataDigest, releaseIdentity } = pins;
|
|
19
|
+
return selectInstallation({ layout: 'bundle', root, metadataPath, metadataDigest, releaseIdentity, externalRoots });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (isMainModule(import.meta.url)) {
|
|
23
|
+
try {
|
|
24
|
+
const [command, descriptor, ...names] = process.argv.slice(2);
|
|
25
|
+
const result = command === 'capture' ? captureBundleInstallation(dirname(dirname(fileURLToPath(import.meta.url))),
|
|
26
|
+
descriptor ? JSON.parse(readFileSync(descriptor, 'utf8')) : null)
|
|
27
|
+
: command === 'worker' ? workerResources(JSON.parse(readFileSync(descriptor, 'utf8')),
|
|
28
|
+
names.map((canonicalName) => ({ canonicalName }))) : null;
|
|
29
|
+
if (!result) throw new Error('Usage: active-installation.mjs capture [expected-pins.json] | worker <installation.json> <canonical-name>...');
|
|
30
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
31
|
+
} catch (error) { process.stderr.write(`${error.message}\n`); process.exitCode = 1; }
|
|
32
|
+
}
|
|
@@ -25,6 +25,7 @@ import { homedir } from 'node:os'
|
|
|
25
25
|
import { dirname, join } from 'node:path'
|
|
26
26
|
import { fileURLToPath } from 'node:url'
|
|
27
27
|
|
|
28
|
+
import { executingBundleRoot } from '../../engineering-runtime/scripts/installation-resolver.mjs'
|
|
28
29
|
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs'
|
|
29
30
|
|
|
30
31
|
export const REHYDRATE = join(dirname(fileURLToPath(import.meta.url)), 'rehydrate.mjs')
|
|
@@ -85,10 +86,12 @@ function readJson(file) {
|
|
|
85
86
|
export function run({ home = homedir(), check = false, harness } = {}) {
|
|
86
87
|
const names = harness ? [harness] : Object.keys(HARNESSES)
|
|
87
88
|
const out = []
|
|
89
|
+
const nativeBundle = executingBundleRoot(dirname(dirname(REHYDRATE)))
|
|
88
90
|
for (const name of names) {
|
|
89
91
|
const h = HARNESSES[name]
|
|
90
92
|
if (!h) throw new InstallHooksError(`unknown harness ${name}: use claude or codex`)
|
|
91
93
|
const file = join(home, h.dir, h.file)
|
|
94
|
+
if (nativeBundle) { out.push({ harness: name, file, status: 'plugin-no-global-hooks' }); continue }
|
|
92
95
|
if (!existsSync(join(home, h.dir))) { out.push({ harness: name, file, status: 'absent' }); continue }
|
|
93
96
|
const settings = readJson(file)
|
|
94
97
|
if (pluginEnabled(settings, name)) { out.push({ harness: name, file, status: 'plugin' }); continue }
|
|
@@ -20,6 +20,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'
|
|
|
20
20
|
import { dirname, join, resolve } from 'node:path'
|
|
21
21
|
import { fileURLToPath } from 'node:url'
|
|
22
22
|
|
|
23
|
+
import { workerResources } from '../../engineering-runtime/scripts/installation-resolver.mjs'
|
|
23
24
|
import { isMainModule } from '../../engineering-runtime/scripts/main-module.mjs'
|
|
24
25
|
import { RULES, SKILL_PATH } from './next-actions.mjs'
|
|
25
26
|
|
|
@@ -54,13 +55,28 @@ export function activeRuns(cwd, now = Date.now(), hours = ACTIVE_HOURS) {
|
|
|
54
55
|
const units = (Array.isArray(plan?.units) ? plan.units : plan?.issues) ?? []
|
|
55
56
|
const open = units.filter((u) => !DONE.has(u?.status)).length
|
|
56
57
|
if (!open) continue
|
|
57
|
-
runs.push({ dir: join(root, name), skill: plan.skill ?? 'resolve-issues', revision: plan.planRevision ?? null, open, mtime
|
|
58
|
+
runs.push({ dir: join(root, name), skill: plan.skill ?? 'resolve-issues', revision: plan.planRevision ?? null, open, mtime,
|
|
59
|
+
...(plan.installation ? { installation: plan.installation } : {}) })
|
|
58
60
|
}
|
|
59
61
|
return runs.sort((a, b) => b.mtime - a.mtime).map(({ mtime, ...r }) => r)
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
export function message(runs, { skillPath = SKILL_PATH, rushSkillPath = RUSH_SKILL_PATH } = {}) {
|
|
63
65
|
if (!runs.length) return ''
|
|
66
|
+
if (runs.some((run) => run.installation)) {
|
|
67
|
+
return runs.map((run) => {
|
|
68
|
+
if (!run.installation) return message([run], { skillPath, rushSkillPath })
|
|
69
|
+
try {
|
|
70
|
+
const names = ['resolve-issues', ...(run.skill === 'rush-issues' ? ['rush-issues'] : [])]
|
|
71
|
+
const resources = workerResources(run.installation, names.map((canonicalName) => ({ canonicalName })))
|
|
72
|
+
return message([{ ...run, installation: undefined }], { skillPath: resources[0].path,
|
|
73
|
+
rushSkillPath: resources.find((entry) => entry.canonicalName === 'rush-issues')?.path ?? rushSkillPath })
|
|
74
|
+
+ `\nSelected installation: ${JSON.stringify(run.installation)}\nReuse this exact root and identity for worker resources; never select another cache or a shared copy.`
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return `Recovery blocked for ${run.dir}: ${error.message}. Do not use another installation or emit shared-store repair commands.`
|
|
77
|
+
}
|
|
78
|
+
}).join('\n\n')
|
|
79
|
+
}
|
|
64
80
|
const skills = [skillPath]
|
|
65
81
|
if (runs.some((r) => r.skill === 'rush-issues') && existsSync(rushSkillPath)) skills.push(rushSkillPath)
|
|
66
82
|
const nextActions = join(dirname(skillPath), 'scripts', 'next-actions.mjs')
|
|
@@ -4,7 +4,7 @@ description: "Slash/explicit-only (/resolve-release). Full GitHub Flow release f
|
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
6
|
workflow-role: coordinator
|
|
7
|
-
release-version: 0.
|
|
7
|
+
release-version: 0.44.1
|
|
8
8
|
---
|
|
9
9
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
10
10
|
# Resolve release
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-quality
|
|
3
3
|
description: "Seven principles for tests that catch real bugs, and an audit that reports weak, redundant, and not-coverage tests without fixing them. Use when writing, changing, or reviewing tests, or when asked whether tests are useful, redundant, over-mocked, flaky, only assert static text, or test config files, or asked to make a slow test suite faster without losing coverage, or when the user asks to write the testing conventions into a repo's CONTRIBUTING.md. NOT defining what a spec must prove (ensure-coverage) or authoring browser tests (e2e-test)."
|
|
4
|
-
release-version: 0.
|
|
4
|
+
release-version: 0.44.1
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Test Quality
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
3
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
8
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -46,6 +46,8 @@ function writeCache(path, value) {
|
|
|
46
46
|
|
|
47
47
|
function main(now = Date.now()) {
|
|
48
48
|
if (process.env.ONEABOVEIO_NO_UPDATE_CHECK) return;
|
|
49
|
+
const bundle = readJson(join(resolve(here, '../../..'), 'package.json'));
|
|
50
|
+
if (bundle.name === '@1aboveio/skills' && bundle.nativeCodex?.schemaVersion === 1) return;
|
|
49
51
|
const skill = readFileSync(join(here, 'SKILL.md'), 'utf8');
|
|
50
52
|
const name = frontmatterValue(skill, 'name');
|
|
51
53
|
const localVersion = stableVersion(frontmatterValue(skill, 'release-version'));
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { test } from 'node:test'
|
|
2
|
-
import assert from 'node:assert/strict'
|
|
3
|
-
import { threeDotRange, parseNameStatus, parseLog, fastForwardable, isPromotionTarget, isIntegrationBranch, isPromotion, reviewNote, normalizeHeadName } from './pr-context.mjs'
|
|
4
|
-
|
|
5
|
-
test('threeDotRange uses three dots (the merge diff, not two-dot)', () => {
|
|
6
|
-
assert.equal(threeDotRange('abc123'), 'abc123...HEAD')
|
|
7
|
-
assert.equal(threeDotRange('abc', 'feat'), 'abc...feat')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
test('parseNameStatus handles add/modify/delete and rename', () => {
|
|
11
|
-
const text = ['M\tsrc/a.ts', 'A\tsrc/new.ts', 'D\tsrc/old.ts', 'R100\tsrc/from.ts\tsrc/to.ts'].join('\n')
|
|
12
|
-
assert.deepEqual(parseNameStatus(text), [
|
|
13
|
-
{ status: 'M', path: 'src/a.ts' },
|
|
14
|
-
{ status: 'A', path: 'src/new.ts' },
|
|
15
|
-
{ status: 'D', path: 'src/old.ts' },
|
|
16
|
-
{ status: 'R100', path: 'src/to.ts' },
|
|
17
|
-
])
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
test('parseNameStatus empty → []', () => {
|
|
21
|
-
assert.deepEqual(parseNameStatus(''), [])
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test('parseLog splits sha + subject', () => {
|
|
25
|
-
const text = '1a2b3c add export\n4d5e6f fix expired coupon'
|
|
26
|
-
assert.deepEqual(parseLog(text), [
|
|
27
|
-
{ sha: '1a2b3c', subject: 'add export' },
|
|
28
|
-
{ sha: '4d5e6f', subject: 'fix expired coupon' },
|
|
29
|
-
])
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
test('fastForwardable: empty = FF possible; non-empty (base has commits head lacks) = not FF', () => {
|
|
33
|
-
assert.equal(fastForwardable([]), true)
|
|
34
|
-
assert.equal(fastForwardable([{ sha: 'h0tf1x', subject: 'hotfix prod' }]), false)
|
|
35
|
-
assert.equal(fastForwardable(undefined), true)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
test('isPromotionTarget: production branches only (the base half of a promotion)', () => {
|
|
39
|
-
assert.equal(isPromotionTarget('main'), true)
|
|
40
|
-
assert.equal(isPromotionTarget('master'), true)
|
|
41
|
-
assert.equal(isPromotionTarget('production'), true)
|
|
42
|
-
assert.equal(isPromotionTarget('origin/main'), true)
|
|
43
|
-
assert.equal(isPromotionTarget('dev'), false)
|
|
44
|
-
assert.equal(isPromotionTarget('feature/x'), false)
|
|
45
|
-
assert.equal(isPromotionTarget('release/1.2'), false)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
test('isIntegrationBranch: only integration/release-shaped heads (the head half of a promotion)', () => {
|
|
49
|
-
// integration branches
|
|
50
|
-
assert.equal(isIntegrationBranch('dev'), true)
|
|
51
|
-
assert.equal(isIntegrationBranch('develop'), true)
|
|
52
|
-
assert.equal(isIntegrationBranch('origin/dev'), true)
|
|
53
|
-
assert.equal(isIntegrationBranch('refs/heads/develop'), true)
|
|
54
|
-
// release / hotfix / staging shapes
|
|
55
|
-
assert.equal(isIntegrationBranch('release/1.4'), true)
|
|
56
|
-
assert.equal(isIntegrationBranch('release/2.0.0'), true)
|
|
57
|
-
assert.equal(isIntegrationBranch('hotfix/urgent-fix'), true)
|
|
58
|
-
assert.equal(isIntegrationBranch('staging'), true)
|
|
59
|
-
assert.equal(isIntegrationBranch('staging/eu'), true)
|
|
60
|
-
assert.equal(isIntegrationBranch('origin/release/1.4'), true)
|
|
61
|
-
// ordinary feature branches — NOT integration
|
|
62
|
-
assert.equal(isIntegrationBranch('feature/x'), false)
|
|
63
|
-
assert.equal(isIntegrationBranch('chore/388-doc-code-prose-audit'), false)
|
|
64
|
-
assert.equal(isIntegrationBranch('issue-392-promotion-heuristic'), false)
|
|
65
|
-
assert.equal(isIntegrationBranch('main'), false)
|
|
66
|
-
assert.equal(isIntegrationBranch('develop-tweaks'), false) // not exactly `develop`
|
|
67
|
-
assert.equal(isIntegrationBranch('feature/release-notes'), false) // `release` not its own segment
|
|
68
|
-
// unresolvable head (a bare SHA, or empty) — NOT integration → safe default
|
|
69
|
-
assert.equal(isIntegrationBranch('a1b2c3d'), false)
|
|
70
|
-
assert.equal(isIntegrationBranch(''), false)
|
|
71
|
-
assert.equal(isIntegrationBranch(undefined), false)
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
test('isPromotion: true ONLY when base is production AND head is integration/release-shaped', () => {
|
|
75
|
-
// the ~15x false-positive this fixes: a feature branch → main is NOT a promotion
|
|
76
|
-
assert.equal(isPromotion('main', 'chore/388-doc-code-prose-audit'), false)
|
|
77
|
-
assert.equal(isPromotion('main', 'feature/x'), false)
|
|
78
|
-
assert.equal(isPromotion('main', 'issue-392-promotion-heuristic'), false)
|
|
79
|
-
// genuine promotions: integration/release branch → production
|
|
80
|
-
assert.equal(isPromotion('main', 'dev'), true)
|
|
81
|
-
assert.equal(isPromotion('main', 'release/1.4'), true)
|
|
82
|
-
assert.equal(isPromotion('main', 'hotfix/x'), true)
|
|
83
|
-
assert.equal(isPromotion('master', 'develop'), true)
|
|
84
|
-
assert.equal(isPromotion('origin/main', 'origin/dev'), true)
|
|
85
|
-
// base is not a production branch → never a promotion, even from an integration head
|
|
86
|
-
assert.equal(isPromotion('dev', 'feature/x'), false)
|
|
87
|
-
assert.equal(isPromotion('release/1.4', 'dev'), false)
|
|
88
|
-
// unresolvable head (bare SHA / empty) → false (documented safe default)
|
|
89
|
-
assert.equal(isPromotion('main', 'a1b2c3d'), false)
|
|
90
|
-
assert.equal(isPromotion('main', ''), false)
|
|
91
|
-
assert.equal(isPromotion('main', undefined), false)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
test('normalizeHeadName strips ONLY known ref prefixes — never an arbitrary leading segment', () => {
|
|
95
|
-
// known ref prefixes → stripped to the bare name
|
|
96
|
-
assert.equal(normalizeHeadName('refs/heads/develop'), 'develop')
|
|
97
|
-
assert.equal(normalizeHeadName('refs/remotes/origin/release/1.4'), 'release/1.4')
|
|
98
|
-
assert.equal(normalizeHeadName('origin/dev'), 'dev')
|
|
99
|
-
assert.equal(normalizeHeadName('origin/release/1.4'), 'release/1.4')
|
|
100
|
-
assert.equal(normalizeHeadName('upstream/staging'), 'staging')
|
|
101
|
-
// NOT a known prefix → left intact (the any-prefix hole this closes)
|
|
102
|
-
assert.equal(normalizeHeadName('jsmith/dev'), 'jsmith/dev')
|
|
103
|
-
assert.equal(normalizeHeadName('feature/release/notes'), 'feature/release/notes')
|
|
104
|
-
assert.equal(normalizeHeadName('team/staging/eu'), 'team/staging/eu')
|
|
105
|
-
// plain names pass through
|
|
106
|
-
assert.equal(normalizeHeadName('dev'), 'dev')
|
|
107
|
-
assert.equal(normalizeHeadName('release/1.4'), 'release/1.4')
|
|
108
|
-
assert.equal(normalizeHeadName(''), '')
|
|
109
|
-
assert.equal(normalizeHeadName(undefined), '')
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
// LEFT-BOUNDARY REGRESSION (issue #392, fix round): the integration/release name must
|
|
113
|
-
// open the branch (after ref-prefix stripping), never be buried under a namespace. A
|
|
114
|
-
// nested-prefix feature branch is an ordinary feature PR, not a promotion — the unsafe
|
|
115
|
-
// direction if mis-classified. Removing the `^`/normalization makes these go RED.
|
|
116
|
-
test('isIntegrationBranch: nested-prefix feature branches are NOT integration (left-boundary hole)', () => {
|
|
117
|
-
// line-79 (release/hotfix/staging path) hole
|
|
118
|
-
assert.equal(isIntegrationBranch('feature/release/notes'), false)
|
|
119
|
-
assert.equal(isIntegrationBranch('feature/hotfix/x'), false)
|
|
120
|
-
assert.equal(isIntegrationBranch('team/staging/eu'), false)
|
|
121
|
-
// line-77 (exact dev/develop/staging) hole
|
|
122
|
-
assert.equal(isIntegrationBranch('jsmith/dev'), false)
|
|
123
|
-
assert.equal(isIntegrationBranch('alice/develop'), false)
|
|
124
|
-
assert.equal(isIntegrationBranch('wip/staging'), false)
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
test('isIntegrationBranch: supported ref prefixes still resolve to TRUE after normalization', () => {
|
|
128
|
-
assert.equal(isIntegrationBranch('origin/dev'), true)
|
|
129
|
-
assert.equal(isIntegrationBranch('refs/heads/develop'), true)
|
|
130
|
-
assert.equal(isIntegrationBranch('refs/remotes/origin/release/1.4'), true)
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
test('isPromotion: nested-prefix feature branches → main are NOT promotions (left-boundary hole)', () => {
|
|
134
|
-
// these all classified promotion=true before the anchor fix (the fail-open direction)
|
|
135
|
-
assert.equal(isPromotion('main', 'feature/release/notes'), false)
|
|
136
|
-
assert.equal(isPromotion('main', 'feature/hotfix/x'), false)
|
|
137
|
-
assert.equal(isPromotion('main', 'team/staging/eu'), false)
|
|
138
|
-
assert.equal(isPromotion('main', 'jsmith/dev'), false)
|
|
139
|
-
assert.equal(isPromotion('main', 'alice/develop'), false)
|
|
140
|
-
assert.equal(isPromotion('main', 'wip/staging'), false)
|
|
141
|
-
// supported prefixes remain genuine promotions
|
|
142
|
-
assert.equal(isPromotion('main', 'refs/heads/develop'), true)
|
|
143
|
-
assert.equal(isPromotion('main', 'refs/remotes/origin/release/1.4'), true)
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
test('reviewNote: PROMOTION + NOT fast-forwardable note still fires for a genuine promotion that is not FF', () => {
|
|
147
|
-
const note = reviewNote({
|
|
148
|
-
promotion: true,
|
|
149
|
-
fastForwardable: false,
|
|
150
|
-
base: 'main',
|
|
151
|
-
head: 'release/1.4',
|
|
152
|
-
commitsOnBaseNotInHead: [{ sha: 'h0tf1x', subject: 'hotfix prod' }],
|
|
153
|
-
})
|
|
154
|
-
assert.match(note, /PROMOTION \+ NOT fast-forwardable/)
|
|
155
|
-
assert.match(note, /main has 1 commit\(s\) not in release\/1\.4/)
|
|
156
|
-
assert.match(note, /HOLD/)
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
test('reviewNote: fast-forwardable promotion → release-readiness note (not a re-review)', () => {
|
|
160
|
-
const note = reviewNote({ promotion: true, fastForwardable: true, base: 'main', head: 'dev', commitsOnBaseNotInHead: [] })
|
|
161
|
-
assert.match(note, /PROMOTION \(fast-forwardable\)/)
|
|
162
|
-
assert.doesNotMatch(note, /NOT fast-forwardable/)
|
|
163
|
-
})
|
|
164
|
-
|
|
165
|
-
test('reviewNote: not a promotion → review the NET diff (the common feature-PR path)', () => {
|
|
166
|
-
const note = reviewNote({ promotion: false, fastForwardable: true, base: 'main', head: 'feature/x', commitsOnBaseNotInHead: [] })
|
|
167
|
-
assert.match(note, /Review the NET diff/)
|
|
168
|
-
})
|