Skip to content

Commit 55db58f

Browse files
refactor(agent-bundle): move test-only host-contract smoke harnesses to tests/support (#655)
* refactor(agent-bundle): move test-only host-contract smoke harnesses to tests/support * Keep strict semver token boundary; name removed type in changeset; fix stale audit path * Reject four-component version tokens instead of reinterpreting the tail
1 parent 71963b4 commit 55db58f

13 files changed

Lines changed: 1192 additions & 1215 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"agent-bundle": minor
3+
---
4+
5+
Remove the test-only host-contract smoke harness from `agent-bundle/api`: `evaluateHostContract`, `compareInstalledHostContract`, `compareLocalHostContract`, `parseHostContractManifest`, `parseRedactedEventEnvelopes`, `nativeHostContractComparisonEnabled`, and their `HostContract*`, `CompareInstalledHostContractOptions`, `NativeHost`, and `RedactedEventEnvelope` types are no longer exported; the native Claude and Codex host proofs (`runNativeClaudeSmoke`, `runCodexNativeSmoke`, …) now live in the test suite. (#655)

‎docs/audits/2026-09-03-claude-live-session-proofs.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ is reproduced here beyond counts, codes, and field names.
8383
`normalHome: 'settings-and-plugins-unchanged'`; `packed-native-smoke.test.ts`
8484
gained a unit test that a `.claude.json` rewrite passes while a
8585
`settings.json` or `plugins/` change fails.
86-
3. **`runNativeClaudeSmoke` (product code,
87-
`packages/agent-bundle/src/host-contracts/native-claude-contract.ts`) has
86+
3. **`runNativeClaudeSmoke` (then product code at
87+
`packages/agent-bundle/src/host-contracts/native-claude-contract.ts`, since moved to `packages/agent-bundle/tests/support/native-claude-smoke.ts`) has
8888
the same guard** and therefore cannot pass on Claude Code 2.1.257: its
8989
`snapshotClaudeNormalHome` digests `.claude.json` (`claudeJson`) beside
9090
`config.json`, `settings.local.json`, `plugins/`, and `settings.json`, and

‎packages/agent-bundle/src/api.ts‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -287,30 +287,6 @@ import {
287287
import { runWithPlatform, withTempDirectory } from './effect/platform.ts';
288288
import { liftPromise } from './effect/lift.ts';
289289

290-
export {
291-
compareInstalledHostContract,
292-
compareLocalHostContract,
293-
evaluateHostContract,
294-
nativeHostContractComparisonEnabled,
295-
parseHostContractManifest,
296-
parseRedactedEventEnvelopes,
297-
} from './host-contracts/host-contract.ts';
298-
export type {
299-
CompareInstalledHostContractOptions,
300-
HostContractCommand,
301-
HostContractCommandResult,
302-
HostContractCommandRunner,
303-
HostContractDiagnostic,
304-
HostContractEvidence,
305-
HostContractHelpProbe,
306-
HostContractManifest,
307-
HostContractProbe,
308-
HostContractProbeKind,
309-
HostContractReport,
310-
HostContractStatus,
311-
NativeHost,
312-
RedactedEventEnvelope,
313-
} from './host-contracts/host-contract.ts';
314290
export { validateClaudePlugin, validateCodexPlugin, validateCursorPlugin, validatePortablePlugin };
315291
export type {
316292
ClaudePluginValidationReport,

‎packages/agent-bundle/src/core/semver.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export interface SemanticVersion {
55
readonly prerelease: boolean;
66
}
77

8-
/** Finds the first semver-shaped token inside surrounding CLI banner text. */
8+
/** Finds the first semver-shaped token inside surrounding CLI banner text; a fourth dotted component disqualifies the token. */
99
export const parseSemanticVersion = (value: string): SemanticVersion | undefined => {
10-
const match = /(?:^|[^0-9])(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?(?:$|[^0-9])/u.exec(value);
10+
const match = /(?:^|[^0-9.])(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?(?=$|[^0-9A-Za-z.-])/u.exec(value);
1111
if (match === null) return undefined;
1212
return Object.freeze({
1313
major: Number(match[1]),

0 commit comments

Comments
 (0)