Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/dsh-loopx-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@ copy under `$DSH_AGENTS_HOME/runtime/dsh-loopx-plugin` (default
`~/.agents/runtime/dsh-loopx-plugin`) and never mutates the system Python
environment. This works with externally managed Python distributions that
enforce PEP 668; the plugin does not use `--break-system-packages`.
This version requires LoopX 1.2.4 or newer, the published release that
includes the Windows peer-file fix. Bootstrap, Driver and GoalBar use the same
The next plugin release requires LoopX 2.4.0 or newer for the original-Turn
`quota receipt` reader. Publish the matching Core release before distributing
the plugin; published LoopX 2.3.0 does not provide that command.
Bootstrap, Driver and GoalBar use the same
version floor; an older global or managed CLI is upgraded or rejected before
business commands run. An explicit outdated `LOOPX_BIN` must be upgraded by its
owner. Older plugin releases retain their original CLI requirements.
The continuation driver follows LoopX's context delivery setting on CLI 2.3
and later. When the guard returns a capture reference, the driver reads the
admission fields from that same capture. The driver requests raw admission
JSON from older supported CLIs.
The continuation driver follows LoopX's context delivery setting.
When the guard returns a capture reference, the driver reads the
admission fields from that same capture.
Install the prebuilt release into the web profile:

```bash
Expand Down Expand Up @@ -491,7 +492,7 @@ The repair command has no arguments. Extra input returns a usage error before an
model work or CLI probe. A valid invocation queues a bounded start followup on
the exact receiving Agent, then probes the current LoopX installation. When the
CLI is missing or lacks the DSH-native skill contract, it runs exactly one
fixed-argv `pip install --upgrade --target <plugin-runtime> 'loopx>=1.2.4'`, writes a
fixed-argv `pip install --upgrade --target <plugin-runtime> 'loopx>=2.4.0'`, writes a
small managed Python launcher beside that target, then uses that same
interpreter and launcher to install and read back the skills. Driver and
GoalBar resolve this same managed runtime, including after an explicit repair.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ set -eu
printf '%s\n' "$*" >> "${cliLog}"
case " $* " in
*" --version "*)
printf '%s\n' 'loopx 1.2.4'
printf '%s\n' 'loopx 2.4.0'
exit 0
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion packages/dsh-loopx-plugin/smoke/dsh-profile-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function exerciseInstalled(installed) {
throw new hostModule.LoopXCliError('aborted', 'cancelled', false)
}
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
return {
Expand Down
6 changes: 3 additions & 3 deletions packages/dsh-loopx-plugin/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { spawn } from 'node:child_process'
import { statSync } from 'node:fs'

// 1.2.4 includes the released Windows peer-file fix. Bootstrap and every
// runtime consumer must use the same floor, including an existing global CLI.
export const MINIMUM_LOOPX_VERSION = '1.2.4'
// 2.4.0 adds the original-Turn receipt reader used by selection recovery.
// Bootstrap and every runtime consumer share this floor, including global CLIs.
export const MINIMUM_LOOPX_VERSION = '2.4.0'

export type LoopXCliErrorKind =
| 'aborted'
Expand Down
16 changes: 8 additions & 8 deletions packages/dsh-loopx-plugin/tests/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ describe('runJsonCommand', () => {
probes += 1
controller.abort()
if (outcome === 'rejected-probe') throw new Error('probe closed during cancellation')
return { exitCode: outcome === 'valid-version' ? 0 : 1, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: outcome === 'valid-version' ? 0 : 1, stdout: 'loopx 2.4.0\n', stderr: '' }
},
})).rejects.toMatchObject({ kind: 'aborted', retryable: false })
expect(probes).toBe(1)
},
)

it.each(['0.5.4', '1.2.3', '1.2.4rc1', '1.2.4.dev1', 'smoke', '1.2.4unknown'])(
it.each(['0.5.4', '1.2.3', '1.2.4', '2.4.0rc1', '2.4.0.dev1', '2.3.0', 'smoke', '2.4.0unknown'])(
'rejects unavailable or pre-fix CLI version %s', async version => {
await expect(resolveLoopXCommand({
env: { LOOPX_BIN: 'configured-loopx' },
Expand All @@ -114,7 +114,7 @@ describe('runJsonCommand', () => {
},
)

it.each(['1.2.4', '1.2.4+local', '1.2.4.post1', '1.2.5rc1', '2.0.0.dev1'])(
it.each(['2.4.0', '2.4.0+local', '2.4.0.post1', '2.4.1rc1', '3.0.0.dev1'])(
'accepts CLI release %s at or after the fixed floor', async version => {
const command = await resolveLoopXCommand({
env: { LOOPX_BIN: 'configured-loopx' },
Expand All @@ -128,7 +128,7 @@ describe('runJsonCommand', () => {
const command = await resolveLoopXCommand({
env: { PYTHON_BIN: 'fixture-python', LOOPX_BIN: '' },
runner: async file => ({
exitCode: 0, stdout: `loopx ${file === 'loopx' ? '1.2.3' : '1.2.4'}\n`, stderr: '',
exitCode: 0, stdout: `loopx ${file === 'loopx' ? '2.3.0' : '2.4.0'}\n`, stderr: '',
}),
})
expect(command.file).toBe('fixture-python')
Expand All @@ -141,7 +141,7 @@ describe('runJsonCommand', () => {
env: { LOOPX_BIN: '' },
runner: async (file, args) => {
attempted.push(`${file} ${args.join(' ')}`)
if (file === 'python') return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
if (file === 'python') return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
throw new LoopXCliError('missing', 'missing', false)
},
})
Expand All @@ -159,7 +159,7 @@ describe('runJsonCommand', () => {
runner: async (file, args) => {
expect(file).toBe(configured)
expect(args).toEqual(['--version'])
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
},
})

Expand All @@ -174,7 +174,7 @@ describe('runJsonCommand', () => {
if (file === 'loopx') return { exitCode: 127, stdout: '', stderr: '' }
expect(file).toBe(python)
expect(args).toEqual(['-m', 'loopx.cli', '--version'])
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
},
})

Expand All @@ -189,7 +189,7 @@ describe('runJsonCommand', () => {
runner: async (file, args) => {
expect(file).toBe(python)
expect(args).toEqual([launcher, '--version'])
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
},
})

Expand Down
2 changes: 1 addition & 1 deletion packages/dsh-loopx-plugin/tests/driver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function runnerFixture(options: {
runner: async (_file, args) => {
calls.push([...args])
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('resolve-agent-thread')) {
const threadIdIndex = args.indexOf('--thread-id')
Expand Down
64 changes: 33 additions & 31 deletions packages/dsh-loopx-plugin/tests/init-command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function successfulRunner(options: {
if (args.at(-1) === '--version') {
options.events?.push('probe')
if (!cliAvailable) throw new LoopXCliError('missing', 'missing', false)
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
options.events?.push('install-skills')
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('/loopx-init implementation', () => {
const runner: FileRunner = async (_file, args) => {
calls.push([...args])
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
if (args.includes('--install')) {
Expand All @@ -262,7 +262,7 @@ describe('/loopx-init implementation', () => {
})

expect(result).toEqual({
cliVersion: 'loopx 1.2.4',
cliVersion: 'loopx 2.4.0',
cliInstalled: false,
skillsInstalled: true,
skillsChanged: false,
Expand All @@ -278,7 +278,7 @@ describe('/loopx-init implementation', () => {
const runner: FileRunner = async (_file, args) => {
calls.push([...args])
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
const operation = args.includes('--install') ? 'install' : 'inspect'
return {
Expand Down Expand Up @@ -316,7 +316,7 @@ describe('/loopx-init implementation', () => {
}
if (args.at(-1) === '--version') {
if (!installed) throw new LoopXCliError('missing', 'missing', false)
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
const operation = args.includes('--install') ? 'install' : 'inspect'
Expand Down Expand Up @@ -364,7 +364,7 @@ describe('/loopx-init implementation', () => {
if (file !== 'python3.13' || !installed) {
throw new LoopXCliError('missing', 'missing', false)
}
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
const operation = args.includes('--install') ? 'install' : 'inspect'
Expand Down Expand Up @@ -399,7 +399,7 @@ describe('/loopx-init implementation', () => {
))).toBe(true)
const pipCall = calls.find(call => call.args.slice(0, 3).join(' ') === '-m pip install')
expect(pipCall?.args).toContain('--target')
expect(pipCall?.args.at(-1)).toBe('loopx>=1.2.4')
expect(pipCall?.args.at(-1)).toBe('loopx>=2.4.0')
expect(pipCall?.args[pipCall.args.indexOf('--target') + 1]).toBe(
'/fixture/runtime/site-packages',
)
Expand Down Expand Up @@ -437,7 +437,7 @@ describe('/loopx-init implementation', () => {
}
if (args.at(-1) === '--version') {
if (!installed) throw new LoopXCliError('missing', 'missing', false)
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
const operation = args.includes('--install') ? 'install' : 'inspect'
Expand Down Expand Up @@ -509,7 +509,7 @@ describe('/loopx-init implementation', () => {
if (file !== 'python3.14' || !installed) {
throw new LoopXCliError('missing', 'missing', false)
}
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
const operation = args.includes('--install') ? 'install' : 'inspect'
Expand Down Expand Up @@ -587,7 +587,7 @@ describe('/loopx-init implementation', () => {
calls.push({ file, args: [...args] })
if (args.at(-1) === '--version') {
if (args[0] !== launcherPath) throw new LoopXCliError('missing', 'missing', false)
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('workflow-skills')) {
const operation = args.includes('--install') ? 'install' : 'inspect'
Expand Down Expand Up @@ -621,7 +621,7 @@ describe('/loopx-init implementation', () => {
}
})

it('upgrades a pre-1.2.4 CLI before inspecting or mutating skills', async () => {
it('upgrades a pre-2.4.0 CLI before inspecting or mutating skills', async () => {
let upgraded = false
let pipCalls = 0
let prematureWorkflowCalls = 0
Expand All @@ -633,7 +633,7 @@ describe('/loopx-init implementation', () => {
return { exitCode: 0, stdout: 'pip fixture', stderr: '' }
}
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: `loopx ${upgraded ? '1.2.4' : '1.2.3'}\n`, stderr: '' }
return { exitCode: 0, stdout: `loopx ${upgraded ? '2.4.0' : '2.3.0'}\n`, stderr: '' }
}
if (args.slice(0, 3).join(' ') === '-m pip install') {
pipCalls += 1
Expand Down Expand Up @@ -665,18 +665,20 @@ describe('/loopx-init implementation', () => {
expect(prematureWorkflowCalls).toBe(0)
})

it('fails an explicit old CLI before pip installation or skill mutation', async () => {
const calls: string[][] = []
await expect(initializeLoopX({
env: { LOOPX_BIN: 'explicit-old-loopx' },
runner: async (file, args) => {
expect(file).toBe('explicit-old-loopx')
calls.push([...args])
return { exitCode: 0, stdout: 'loopx 1.2.3\n', stderr: '' }
},
})).rejects.toMatchObject({ stage: 'probe', causeKind: 'incompatible' })
expect(calls).toEqual([['--version']])
})
it.each(['1.2.3', '1.2.4', '2.3.0', '2.4.0rc1'])(
'fails explicit unsupported CLI %s before pip installation or skill mutation', async version => {
const calls: string[][] = []
await expect(initializeLoopX({
env: { LOOPX_BIN: 'explicit-old-loopx' },
runner: async (file, args) => {
expect(file).toBe('explicit-old-loopx')
calls.push([...args])
return { exitCode: 0, stdout: `loopx ${version}\n`, stderr: '' }
},
})).rejects.toMatchObject({ stage: 'probe', causeKind: 'incompatible' })
expect(calls).toEqual([['--version']])
},
)

it.each([
['created packaged skill', 'created', 'unchanged'],
Expand Down Expand Up @@ -722,7 +724,7 @@ describe('/loopx-init implementation', () => {
) => {
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
return {
Expand All @@ -742,7 +744,7 @@ describe('/loopx-init implementation', () => {
let installCalls = 0
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
installCalls += 1
Expand Down Expand Up @@ -773,7 +775,7 @@ describe('/loopx-init implementation', () => {
let inspectCalls = 0
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
return { exitCode: 0, stdout: workflowPayload('install'), stderr: '' }
Expand Down Expand Up @@ -806,7 +808,7 @@ describe('/loopx-init implementation', () => {
let installCalls = 0
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
installCalls += 1
Expand Down Expand Up @@ -932,7 +934,7 @@ describe('/loopx-init followups', () => {
let installCalls = 0
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
installCalls += 1
Expand Down Expand Up @@ -970,7 +972,7 @@ describe('/loopx-init followups', () => {
let installCalls = 0
const runner: FileRunner = async (_file, args) => {
if (args.at(-1) === '--version') {
return { exitCode: 0, stdout: 'loopx 1.2.4\n', stderr: '' }
return { exitCode: 0, stdout: 'loopx 2.4.0\n', stderr: '' }
}
if (args.includes('--install')) {
installCalls += 1
Expand Down Expand Up @@ -1013,7 +1015,7 @@ describe('/loopx-init followups', () => {
expect(result).toEqual({
kind: 'success',
text: [
'LoopX ready (loopx 1.2.4).',
'LoopX ready (loopx 2.4.0).',
'CLI already compatible.',
'DSH LoopX skills installed or updated and verified.',
'No DSH restart is required; use the `loopx` skill with your task.',
Expand Down
Loading