@pulsehub/runner 0.1.7 → 0.1.9
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 +1 -1
- package/src/process.js +1 -1
- package/src/qa-source.py +1 -1
- package/test/process.test.js +1 -1
- package/test/qa-source.test.js +25 -0
package/package.json
CHANGED
package/src/process.js
CHANGED
|
@@ -57,7 +57,7 @@ export async function executable(name) { try { return (await command(resolveExec
|
|
|
57
57
|
|
|
58
58
|
export function agentPermissionArgs(kind, mode) {
|
|
59
59
|
if (mode === 'review') {
|
|
60
|
-
if (kind === 'codex') return ['--sandbox', 'read-only'
|
|
60
|
+
if (kind === 'codex') return ['--sandbox', 'read-only'];
|
|
61
61
|
if (kind === 'claude') return ['--permission-mode', 'plan'];
|
|
62
62
|
}
|
|
63
63
|
if (kind === 'codex') return ['--approve-for-me'];
|
package/src/qa-source.py
CHANGED
|
@@ -13,7 +13,7 @@ import zipfile
|
|
|
13
13
|
def call(body):
|
|
14
14
|
request = urllib.request.Request(os.environ['PULSE_QA_SOURCE_URL'],
|
|
15
15
|
data=json.dumps(body).encode(), headers={
|
|
16
|
-
'
|
|
16
|
+
'X-Pulse-QA-Credential': os.environ['PULSE_QA_CREDENTIAL'],
|
|
17
17
|
'Content-Type': 'application/json'})
|
|
18
18
|
try:
|
|
19
19
|
with urllib.request.urlopen(request, timeout=540) as response:
|
package/test/process.test.js
CHANGED
|
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
|
|
|
3
3
|
import { agentPermissionArgs, mcpEndpoint } from '../src/process.js';
|
|
4
4
|
|
|
5
5
|
test('QA Runner sessions use read-only filesystem permissions', () => {
|
|
6
|
-
assert.deepEqual(agentPermissionArgs('codex', 'review'), ['--sandbox', 'read-only'
|
|
6
|
+
assert.deepEqual(agentPermissionArgs('codex', 'review'), ['--sandbox', 'read-only']);
|
|
7
7
|
assert.deepEqual(agentPermissionArgs('claude', 'review'), ['--permission-mode', 'plan']);
|
|
8
8
|
});
|
|
9
9
|
|
package/test/qa-source.test.js
CHANGED
|
@@ -34,6 +34,31 @@ with tempfile.TemporaryDirectory() as root:
|
|
|
34
34
|
assert.equal(result.code, 0, result.output);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
test('Runner sends its QA application credential outside the Authorization header', async () => {
|
|
38
|
+
const script = `
|
|
39
|
+
import importlib.util,os
|
|
40
|
+
from pathlib import Path
|
|
41
|
+
spec=importlib.util.spec_from_file_location('qa_source',os.environ['QA_SCRIPT'])
|
|
42
|
+
m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
|
|
43
|
+
seen=[]
|
|
44
|
+
class Response:
|
|
45
|
+
def __enter__(self): return self
|
|
46
|
+
def __exit__(self,*args): pass
|
|
47
|
+
def read(self,size): return b'{}'
|
|
48
|
+
def fake(request,timeout):
|
|
49
|
+
seen.append({k.lower():v for k,v in request.header_items()})
|
|
50
|
+
return Response()
|
|
51
|
+
m.urllib.request.urlopen=fake
|
|
52
|
+
os.environ['PULSE_QA_SOURCE_URL']='https://example.invalid/pulseQaSource'
|
|
53
|
+
os.environ['PULSE_QA_CREDENTIAL']='fixture-only'
|
|
54
|
+
m.call({'identifier':'TES-fixture'})
|
|
55
|
+
assert seen[0]['x-pulse-qa-credential']=='fixture-only'
|
|
56
|
+
assert 'authorization' not in seen[0]
|
|
57
|
+
`;
|
|
58
|
+
const result = await command('python3', ['-c', script], { env: { ...process.env, PYTHONDONTWRITEBYTECODE: '1', QA_SCRIPT: fileURLToPath(new URL('../src/qa-source.py', import.meta.url)) } });
|
|
59
|
+
assert.equal(result.code, 0, result.output);
|
|
60
|
+
});
|
|
61
|
+
|
|
37
62
|
test('both local QA identities use provider readiness independently of global Git credentials', () => {
|
|
38
63
|
for (const kind of ['codex','claude']) {
|
|
39
64
|
const config = { identities: [{ agentId: kind, kind, role: 'qa' }] };
|