Files
stack/agents/rocko/work/queue-219/r4/assertion-preservation.json

47 lines
5.0 KiB
JSON

{
"baseHead": "bfa421b6cd9b2b54d8da119e73b004aeafe606c3",
"ruling": "mos-1429 / sage-3291",
"grantTest": {
"old": "test('sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record', async (t) => {\n const f = await setup(t);\n assert.equal((await f.approve()).end.action, 'grant.applied');\n const r = await restart(t, f, creativeOps(f.business));\n const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' });\n r.broker.request(cap, { verb: 'role.claim' });\n const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') });\n const before = f.requests().length;\n await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');\n assert.equal(f.requests().length, before);\n assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);\n assert.notEqual(f.record(), undefined);\n});\n",
"new": "test('sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record', async (t) => {\n const f = await setup(t);\n assert.equal((await f.approve()).end.action, 'grant.applied');\n const r = await restart(t, f, creativeOps(f.business));\n const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true });\n const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id;\n const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id;\n const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread });\n r.broker.request(cap, { verb: 'role.claim' });\n const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') });\n const before = f.requests().length;\n await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');\n assert.equal(f.requests().length, before);\n assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);\n assert.notEqual(f.record(), undefined);\n});\n",
"preservedOldLines": [
" assert.equal((await f.approve()).end.action, 'grant.applied');",
" const r = await restart(t, f, creativeOps(f.business));",
" const before = f.requests().length;",
" await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');",
" assert.equal(f.requests().length, before);",
" assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);",
" assert.notEqual(f.record(), undefined);"
],
"preservedNewLines": [
" assert.equal((await f.approve()).end.action, 'grant.applied');",
" const r = await restart(t, f, creativeOps(f.business));",
" const before = f.requests().length;",
" await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');",
" assert.equal(f.requests().length, before);",
" assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);",
" assert.notEqual(f.record(), undefined);"
]
},
"projectRuntime": {
"oldPin": [
" \"import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';\","
],
"newPin": [
" \"import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';\","
],
"oldDoesNotMatch": [
" assert.doesNotMatch(source, /\\bimport\\s*\\(/);",
" assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);",
" assert.doesNotMatch(readFileSync(new URL('../../business/src/vocabulary.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);",
" assert.doesNotMatch(readFileSync(new URL('../../plugins/src/kinds.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);"
],
"newDoesNotMatch": [
" assert.doesNotMatch(source, /\\bimport\\s*\\(/);",
" assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);",
" assert.doesNotMatch(readFileSync(new URL('../../business/src/vocabulary.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);",
" assert.doesNotMatch(readFileSync(new URL('../../plugins/src/kinds.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);"
]
}
}