@christang/keel 5.231.12 → 5.232.0
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/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -3
- package/README.zh-CN.md +5 -3
- package/assets/bootstrap/AGENTS.md +2 -2
- package/bin/keel.js +163 -24
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/hooks.json +23 -0
- package/plugins/keel/plugin.json +10 -0
- package/plugins/keel/scripts/pretooluse-guard.js +42 -1
- package/plugins/keel/scripts/session-start.js +47 -6
- package/scripts/bump_version.js +3 -0
- package/scripts/install_to_repo.py +4 -3
- package/scripts/test_codex_host.js +44 -0
- package/scripts/validation/agy.py +770 -0
- package/scripts/validation/baseline.py +19 -3
- package/scripts/validation/common.py +2 -2
- package/scripts/validation/hosts.py +7 -3
- package/scripts/validation/registry.py +7 -0
- package/src/core/capabilities.js +65 -13
- package/src/core/codex-host.js +18 -11
- package/src/core/gates.js +3 -3
- package/src/core/projection.js +1 -1
|
@@ -66,6 +66,50 @@ test('list managed roles offline without draining or changing the shared mailbox
|
|
|
66
66
|
assert.equal(connections, 0);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
test('damaged delivery claims stay unknown and refuse offline replay', async t => {
|
|
70
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'keel-damaged-claim-'));
|
|
71
|
+
t.after(() => fs.rmSync(dir, {recursive: true, force: true}));
|
|
72
|
+
require('node:child_process').execFileSync('git', ['init', '-q', dir]);
|
|
73
|
+
const store = require('../src/core/chat/store');
|
|
74
|
+
const where = store.requireLocation(dir);
|
|
75
|
+
store.createGroup(where, 'owner', 'team', ['worker']);
|
|
76
|
+
const todo = store.writeRecord(where, {group: 'team', kind: 'todo', from: 'owner', assignee: 'worker', text: 'verify artifact'});
|
|
77
|
+
const key = crypto.createHash('sha256').update(todo.id).digest('hex');
|
|
78
|
+
const registry = path.join(where.root, 'codex-roles', 'worker.json');
|
|
79
|
+
const base = {state: 'managed', role: 'worker', worktree: where.worktree, socket: path.join(dir, 'offline.sock'), thread: 'original'};
|
|
80
|
+
const args = ['--repo', dir, '--role', 'worker', '--record', todo.id, '--json'];
|
|
81
|
+
fs.mkdirSync(path.dirname(registry), {recursive: true});
|
|
82
|
+
const cases = [
|
|
83
|
+
[undefined, 'unrecorded'], [{}, 'unrecorded'],
|
|
84
|
+
[{[key]: null}, 'unknown'], [{[key]: false}, 'unknown'], [{[key]: 0}, 'unknown'], [{[key]: ''}, 'unknown'],
|
|
85
|
+
[null, 'invalid-map'], [false, 'invalid-map'], [[], 'invalid-map'],
|
|
86
|
+
];
|
|
87
|
+
for (const [deliveries, expected] of cases) {
|
|
88
|
+
const before = JSON.stringify({...base, deliveries});
|
|
89
|
+
fs.writeFileSync(registry, before);
|
|
90
|
+
const status = await run([...args, '--observe']);
|
|
91
|
+
const missing = expected === 'unrecorded';
|
|
92
|
+
if (expected === 'invalid-map') {
|
|
93
|
+
assert.notEqual(status.code, 0);
|
|
94
|
+
assert.match(status.err, /claim map/);
|
|
95
|
+
} else {
|
|
96
|
+
assert.equal(status.code, 0, status.err);
|
|
97
|
+
const receipt = JSON.parse(status.out);
|
|
98
|
+
assert.equal(receipt.state, expected, before);
|
|
99
|
+
assert.equal(receipt.observation.state, 'unknown');
|
|
100
|
+
}
|
|
101
|
+
const portable = await run(['--repo', dir, 'show', todo.id, '--json'], 'chat');
|
|
102
|
+
assert.equal(portable.code, 0, portable.err);
|
|
103
|
+
assert.equal(JSON.parse(portable.out).delivery.state, missing ? 'unobserved' : 'unknown');
|
|
104
|
+
if (!missing) {
|
|
105
|
+
const retry = await run([...args, '--text', 'must not run'], 'deliver');
|
|
106
|
+
assert.notEqual(retry.code, 0);
|
|
107
|
+
assert.match(retry.err, /outcome unknown/);
|
|
108
|
+
}
|
|
109
|
+
assert.equal(fs.readFileSync(registry, 'utf8'), before);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
69
113
|
test('managed CLI lifecycle, mailbox scheduling and frame boundaries',async()=>{
|
|
70
114
|
const dir=fs.mkdtempSync(path.join(os.tmpdir(),'keel-host-'));const sock=path.join(dir,'host.sock');const requests=[];const requestDetails=[];const peers=[];const blank=new Set(),lost=new Set();let active=true,serial=0,uncertain=false,invalidHost=false,injectNotice=false,unloaded=false,resumeActive=false,resumeFails=false,resumeMismatch=false,readMismatch=false,resumeDelay=false,initNameFails=false;
|
|
71
115
|
let observationTurn = null;
|