instar 1.3.1033 → 1.3.1034
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/dist/commands/devPreflight.d.ts +21 -0
- package/dist/commands/devPreflight.d.ts.map +1 -1
- package/dist/commands/devPreflight.js +38 -2
- package/dist/commands/devPreflight.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.1034.md +48 -0
- package/upgrades/side-effects/preflight-lint-manager-resolve.md +115 -0
|
@@ -10,6 +10,10 @@ export interface DevPreflightOutput {
|
|
|
10
10
|
write(text: string): void;
|
|
11
11
|
error(text: string): void;
|
|
12
12
|
}
|
|
13
|
+
export interface LintCommand {
|
|
14
|
+
command: string;
|
|
15
|
+
args: string[];
|
|
16
|
+
}
|
|
13
17
|
export interface DevPreflightOptions {
|
|
14
18
|
cwd?: string;
|
|
15
19
|
baseRef?: string;
|
|
@@ -17,6 +21,8 @@ export interface DevPreflightOptions {
|
|
|
17
21
|
output?: DevPreflightOutput;
|
|
18
22
|
capabilityPrefixes?: Set<string>;
|
|
19
23
|
diffProvider?: () => string;
|
|
24
|
+
/** Injectable so callers/tests pin the manager instead of probing the host. */
|
|
25
|
+
lintCommandResolver?: () => LintCommand | null;
|
|
20
26
|
}
|
|
21
27
|
export interface RouteWarning {
|
|
22
28
|
prefix: string;
|
|
@@ -40,6 +46,21 @@ export declare class SpawnDevPreflightRunner implements DevPreflightRunner {
|
|
|
40
46
|
constructor(cwd: string);
|
|
41
47
|
run(command: string, args: string[], label: string): Promise<CommandResult>;
|
|
42
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the package manager that runs `lint`.
|
|
51
|
+
*
|
|
52
|
+
* This repo's manager is pnpm, but preflight also runs where pnpm is absent:
|
|
53
|
+
* CI installs with `npm ci` and never installs pnpm (.github/workflows/ci.yml).
|
|
54
|
+
* A hardcoded `pnpm` produced `lint failed to start: spawn pnpm ENOENT` there,
|
|
55
|
+
* which the summary then reported as a lint FAILURE — an environment gap
|
|
56
|
+
* rendered as a verdict about the code. The neighbouring discoverability step
|
|
57
|
+
* already avoided this by spawning `npx`.
|
|
58
|
+
*
|
|
59
|
+
* Returns null when neither manager is usable. The caller reports that as an
|
|
60
|
+
* explicit skipped check and fails the run — it is never counted as a pass,
|
|
61
|
+
* because "the check could not run" and "the check passed" must not look alike.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveLintCommand(probe?: (command: string) => boolean): LintCommand | null;
|
|
43
64
|
export declare function extractAddedRoutePrefixes(diff: string): Map<string, string[]>;
|
|
44
65
|
export declare function findMissingCapabilityPrefixes(diff: string, capabilityPrefixes: Set<string>): RouteWarning[];
|
|
45
66
|
export declare function aggregateExitCode(summary: DevPreflightSummary): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devPreflight.d.ts","sourceRoot":"","sources":["../../src/commands/devPreflight.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,kBAAkB,CAAC,EAAE,GAAG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E,YAAY,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAeD,qBAAa,uBAAwB,YAAW,kBAAkB;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,MAAM;IAExC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAkB5E;AAQD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAyB,GACpD,WAAW,GAAG,IAAI,CAIpB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAe7E;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC9B,YAAY,EAAE,CAShB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAMtE;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,iDAAiD,CAAC;AAExF,wBAAgB,yBAAyB,IAAI,GAAG,CAAC,MAAM,CAAC,CAEvD;AAwDD,wBAAsB,eAAe,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ExF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
1
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import pc from 'picocolors';
|
|
@@ -36,6 +36,32 @@ export class SpawnDevPreflightRunner {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
/** True when `command` is on PATH and answers `--version`. */
|
|
40
|
+
function isUsableManager(command) {
|
|
41
|
+
const probe = spawnSync(command, ['--version'], { stdio: 'ignore' });
|
|
42
|
+
return !probe.error && probe.status === 0;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the package manager that runs `lint`.
|
|
46
|
+
*
|
|
47
|
+
* This repo's manager is pnpm, but preflight also runs where pnpm is absent:
|
|
48
|
+
* CI installs with `npm ci` and never installs pnpm (.github/workflows/ci.yml).
|
|
49
|
+
* A hardcoded `pnpm` produced `lint failed to start: spawn pnpm ENOENT` there,
|
|
50
|
+
* which the summary then reported as a lint FAILURE — an environment gap
|
|
51
|
+
* rendered as a verdict about the code. The neighbouring discoverability step
|
|
52
|
+
* already avoided this by spawning `npx`.
|
|
53
|
+
*
|
|
54
|
+
* Returns null when neither manager is usable. The caller reports that as an
|
|
55
|
+
* explicit skipped check and fails the run — it is never counted as a pass,
|
|
56
|
+
* because "the check could not run" and "the check passed" must not look alike.
|
|
57
|
+
*/
|
|
58
|
+
export function resolveLintCommand(probe = isUsableManager) {
|
|
59
|
+
if (probe('pnpm'))
|
|
60
|
+
return { command: 'pnpm', args: ['lint'] };
|
|
61
|
+
if (probe('npm'))
|
|
62
|
+
return { command: 'npm', args: ['run', 'lint'] };
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
39
65
|
export function extractAddedRoutePrefixes(diff) {
|
|
40
66
|
const prefixes = new Map();
|
|
41
67
|
for (const line of diff.split('\n')) {
|
|
@@ -148,7 +174,17 @@ export async function runDevPreflight(options = {}) {
|
|
|
148
174
|
const runner = options.runner ?? new SpawnDevPreflightRunner(cwd);
|
|
149
175
|
output.write(`${pc.bold('Instar dev preflight')}\n`);
|
|
150
176
|
output.write('Verify-only: this command never edits CapabilityIndex or server routes.\n\n');
|
|
151
|
-
const
|
|
177
|
+
const lintCommand = (options.lintCommandResolver ?? resolveLintCommand)();
|
|
178
|
+
let lint;
|
|
179
|
+
if (lintCommand) {
|
|
180
|
+
lint = await runner.run(lintCommand.command, lintCommand.args, 'lint');
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// Report the gap as a gap. A check that could not run must not be
|
|
184
|
+
// indistinguishable from one that ran and passed.
|
|
185
|
+
output.error('lint: no usable package manager found (tried pnpm, npm) — check DID NOT RUN\n');
|
|
186
|
+
lint = { command: 'pnpm', args: ['lint'], exitCode: 1 };
|
|
187
|
+
}
|
|
152
188
|
output.write('\n');
|
|
153
189
|
const discoverability = await runner.run('npx', DISCOVERABILITY_TEST_ARGS, 'capabilities discoverability');
|
|
154
190
|
// ── Test-runner bound: self-disable ledger check (spec §2.6(b)) ──────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devPreflight.js","sourceRoot":"","sources":["../../src/commands/devPreflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"devPreflight.js","sourceRoot":"","sources":["../../src/commands/devPreflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAoDnE,MAAM,yBAAyB,GAAG;IAChC,QAAQ;IACR,KAAK;IACL,iDAAiD;IACjD,oCAAoC;CACrC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChE,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAC3C,MAAM,CAAC,GAAG,CAAA,sBAAsB,aA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EAAE,CAAC;QACtC,MAAM,CAAC,KAAK,CACV,sCAAsC,mBAAmB,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,0EAA0E,CAC9K,CAAC;IACJ,CAAC;IACD,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAChE,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,yGAAyG,CAAC,CAAC;IAC1H,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-07-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-07-28T18:08:03.276Z",
|
|
5
|
+
"instarVersion": "1.3.1034",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
`instar dev:preflight` launched its lint step with a hardcoded `pnpm lint`. Environments
|
|
9
|
+
that install with `npm ci` and have no pnpm — GitHub Actions CI among them — could not
|
|
10
|
+
start that step at all: it died with `spawn pnpm ENOENT`, and the preflight summary
|
|
11
|
+
reported that as a **lint failure**. A missing tool was being reported as broken code.
|
|
12
|
+
|
|
13
|
+
The lint step now resolves the package manager it can actually use: pnpm when available,
|
|
14
|
+
`npm run lint` otherwise. Both execute the identical `scripts.lint` chain, so no check
|
|
15
|
+
changes. When neither manager is usable the run fails and states `check DID NOT RUN`,
|
|
16
|
+
rather than continuing or reporting a pass — "this check passed" and "this check could
|
|
17
|
+
not run" must not look alike.
|
|
18
|
+
|
|
19
|
+
The neighbouring discoverability step already spawned `npx` and was unaffected; only the
|
|
20
|
+
lint step hardcoded a manager.
|
|
21
|
+
|
|
22
|
+
## What to Tell Your User
|
|
23
|
+
|
|
24
|
+
Nothing changes in how your agent behaves — this is contributor tooling, not runtime.
|
|
25
|
+
There is no new command, setting, message, or surface, and nothing you need to do.
|
|
26
|
+
|
|
27
|
+
If you contribute to instar and have ever seen the pre-pull-request check report a
|
|
28
|
+
linting failure you could not reproduce, that was most likely this: the linter never
|
|
29
|
+
ran at all, and the tool called that a failure. It now runs using whichever package
|
|
30
|
+
manager your machine actually has.
|
|
31
|
+
|
|
32
|
+
## Summary of New Capabilities
|
|
33
|
+
|
|
34
|
+
None — no new user-facing capability. `instar dev:preflight` now works on machines that
|
|
35
|
+
have npm but not pnpm, and reports a check it could not run as exactly that rather than
|
|
36
|
+
as a pass or a false failure.
|
|
37
|
+
|
|
38
|
+
## Evidence
|
|
39
|
+
|
|
40
|
+
- Built `dist/` and ran the real CLI under `env -i PATH=<pnpm absent, npm present>` — the
|
|
41
|
+
exact CI condition. It selects `npm run lint` and exits **0**.
|
|
42
|
+
- The known-fail control is the production CI log itself, which recorded
|
|
43
|
+
`lint failed to start: spawn pnpm ENOENT` before this change.
|
|
44
|
+
- New unit tests cover pnpm-present, pnpm-absent, both-present, and neither. The neither
|
|
45
|
+
case asserts the run does not report a pass and never spawns a lint step.
|
|
46
|
+
- The existing integration test's exact-command assertion is preserved; the resolver is
|
|
47
|
+
injected at both call sites so the test does not become host-dependent.
|
|
48
|
+
- `tsc --noEmit` clean; 7/7 tests on the changed surface.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Side-effects review — preflight lint package-manager resolution
|
|
2
|
+
|
|
3
|
+
**Change.** `dev:preflight` ran `runner.run('pnpm', ['lint'], 'lint')`. CI installs with
|
|
4
|
+
`npm ci` and never installs pnpm, so the step failed to START there (`spawn pnpm ENOENT`)
|
|
5
|
+
and the summary reported it as a lint FAILURE. Resolve the manager instead (pnpm
|
|
6
|
+
preferred, `npm run lint` fallback) via an injectable probe; when neither is usable the
|
|
7
|
+
run fails and says `check DID NOT RUN`.
|
|
8
|
+
|
|
9
|
+
**Tier declared: 1.** Signal was 2 (`size=2, riskFloor=1`, 48 LOC / 1 file). The risk
|
|
10
|
+
floor is 1 — no safety-invariant, irreversibility, migration, or new-capability signal.
|
|
11
|
+
Size alone crossed the 40-LOC bar, and 8 of those lines are the doc comment recording
|
|
12
|
+
why. Trimming the comment to slip under the bar would be gaming the gate, so the tier is
|
|
13
|
+
declared openly instead. A converged spec for a package-manager lookup in a contributor
|
|
14
|
+
CLI is disproportionate. Recorded as `belowFloor`.
|
|
15
|
+
|
|
16
|
+
## 1. Over-block — what legitimate inputs does this reject that it shouldn't?
|
|
17
|
+
|
|
18
|
+
None identified. The change strictly widens what succeeds: previously only a host with
|
|
19
|
+
pnpm could run the lint step, now pnpm **or** npm works. No input that passed before
|
|
20
|
+
fails now. The one new failure path (neither manager present) previously produced the
|
|
21
|
+
same nonzero exit — it is now merely *explained*.
|
|
22
|
+
|
|
23
|
+
## 2. Under-block — what failure modes does this still miss?
|
|
24
|
+
|
|
25
|
+
- **A manager that exists but is broken.** The probe runs `--version` and checks exit 0.
|
|
26
|
+
A pnpm that answers `--version` but cannot run scripts still selects pnpm and fails at
|
|
27
|
+
the lint step. Accepted: that failure is loud and correctly attributed to lint.
|
|
28
|
+
- **Manager-specific lint behaviour.** `pnpm lint` and `npm run lint` both execute the
|
|
29
|
+
same `scripts.lint` string, so the executed command is identical. If a future lint
|
|
30
|
+
script relied on pnpm-specific resolution the two would diverge silently. Not the case
|
|
31
|
+
today (verified: the script is a plain `tsc --noEmit && node scripts/...` chain).
|
|
32
|
+
- **Manager choice is not reported in the summary line.** The spawn banner prints
|
|
33
|
+
`$ npm run lint`, so it is visible in output, but the PASS/FAIL summary does not name
|
|
34
|
+
the manager. Acceptable for a developer tool.
|
|
35
|
+
|
|
36
|
+
## 3. Level-of-abstraction fit
|
|
37
|
+
|
|
38
|
+
Correct layer. The knowledge "which package manager can run a script here" belongs to
|
|
39
|
+
the process that spawns it. The neighbouring call one line down already resolved this
|
|
40
|
+
correctly by spawning `npx`; only the lint step hardcoded a manager. This makes the two
|
|
41
|
+
adjacent calls consistent rather than introducing a new concept.
|
|
42
|
+
|
|
43
|
+
## 4. Signal vs authority compliance
|
|
44
|
+
|
|
45
|
+
Compliant, and it moves toward the principle rather than away.
|
|
46
|
+
|
|
47
|
+
`dev:preflight` is an authority — its exit code gates a contributor's push. The defect
|
|
48
|
+
was an authority drawing a **verdict about the code** from an **environment gap**:
|
|
49
|
+
"pnpm is not installed" was rendered as "lint failed." That is precisely a brittle
|
|
50
|
+
input granted authority it had not earned.
|
|
51
|
+
|
|
52
|
+
The fix keeps authority where it is and repairs its input. It adds no new blocking
|
|
53
|
+
logic. The neither-manager branch deliberately does NOT fail open — it fails closed and
|
|
54
|
+
says `check DID NOT RUN`, because a check that could not run must not be
|
|
55
|
+
indistinguishable from one that ran and passed. That distinction is asserted by test.
|
|
56
|
+
|
|
57
|
+
## 5. Interactions
|
|
58
|
+
|
|
59
|
+
- **Shadowing:** none. No other check resolves a package manager.
|
|
60
|
+
- **Double-fire:** none. The lint step runs exactly once, as before.
|
|
61
|
+
- **Races:** none. The probe is a synchronous `spawnSync('--version')` before any work.
|
|
62
|
+
- **Test coupling:** `tests/integration/dev-preflight-command.test.ts` asserted the exact
|
|
63
|
+
spawned command list including `['pnpm','lint']`. Left probing, that assertion would
|
|
64
|
+
become host-dependent (passing on a dev laptop, failing in CI). The resolver is now
|
|
65
|
+
injected in both call sites so the test stays deterministic and its assertion is
|
|
66
|
+
unchanged — the environment dependency is made explicit rather than removed.
|
|
67
|
+
|
|
68
|
+
## 6. External surfaces
|
|
69
|
+
|
|
70
|
+
No agent-visible, user-visible, or cross-agent surface. `dev:preflight` is a contributor
|
|
71
|
+
command; it is not invoked by runtime agent behaviour, jobs, hooks, or routes. No route,
|
|
72
|
+
config key, message, or persisted state changes. Not timing-dependent.
|
|
73
|
+
|
|
74
|
+
## 7. Multi-machine posture
|
|
75
|
+
|
|
76
|
+
**Machine-local BY DESIGN**, and correctly so: the question answered is "which package
|
|
77
|
+
manager exists on *this* disk." Replicating or proxying that answer would be actively
|
|
78
|
+
wrong — the whole defect was one machine's assumption being applied where it did not
|
|
79
|
+
hold. No durable state, no generated URL, no user-facing notice; nothing to strand on a
|
|
80
|
+
topic transfer.
|
|
81
|
+
|
|
82
|
+
## 8. Rollback cost
|
|
83
|
+
|
|
84
|
+
Trivial. Revert the commit; the resolver is a pure function with an injectable probe and
|
|
85
|
+
no persisted state, no migration, and no config. Nothing to repair. A partial rollback
|
|
86
|
+
(keeping the tests, reverting the resolver) would re-red the CI check.
|
|
87
|
+
|
|
88
|
+
## How this surfaced — worth recording
|
|
89
|
+
|
|
90
|
+
The e2e test `tests/e2e/dev-preflight-cli.test.ts` opens:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const cli = path.join(process.cwd(), 'dist', 'cli.js');
|
|
94
|
+
if (!fs.existsSync(cli)) { return; }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
CI runs vitest on TS source with no preceding build, so `dist/cli.js` never existed and
|
|
98
|
+
this test has been **green by never executing**. PR #1709 adds a globalSetup that builds
|
|
99
|
+
dist — whose own docstring says it exists so a dist-backed test cannot "skip silently" —
|
|
100
|
+
which woke the test and immediately exposed this. #1709 did not break it; it revealed it.
|
|
101
|
+
|
|
102
|
+
The residual defect (a test that passes by returning early) is **not** fixed here: it is
|
|
103
|
+
a test-integrity change with its own blast radius across the e2e suite, and bundling it
|
|
104
|
+
would violate the one-fix-per-artifact rule above. Tracked separately.
|
|
105
|
+
<!-- tracked: ACT-1514 -->
|
|
106
|
+
|
|
107
|
+
## Verification
|
|
108
|
+
|
|
109
|
+
- Built `dist/` and ran the real CLI under `env -i PATH=<no pnpm, npm present>` — the
|
|
110
|
+
exact CI condition. It selects `npm run lint` and exits **0**.
|
|
111
|
+
- Known-fail control is the production CI log itself (`lint failed to start: spawn pnpm
|
|
112
|
+
ENOENT`), i.e. the pre-fix behaviour observed in the environment being fixed.
|
|
113
|
+
- Unit tests cover pnpm-present, pnpm-absent, both-present, and neither; the neither case
|
|
114
|
+
asserts the run does not report a pass and never spawns a lint step.
|
|
115
|
+
- `tsc --noEmit` clean; 7/7 on the changed surface.
|