@zaferyalcin/agent-office 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +476 -2
- package/bin/agent-office.js +64 -0
- package/package.json +25 -4
- package/public/app.css +1035 -0
- package/public/app.js +2034 -0
- package/public/favicon.svg +1 -0
- package/public/i18n.js +1119 -0
- package/public/index.html +141 -0
- package/public/studio.js +1951 -0
- package/public/vendor/three/LICENSE +21 -0
- package/public/vendor/three/three.core.js +61162 -0
- package/public/vendor/three/three.module.js +19537 -0
- package/src/collector.js +501 -0
- package/src/history.js +161 -0
- package/src/open.js +57 -0
- package/src/providers/antigravity-core.js +743 -0
- package/src/providers/antigravity.js +136 -0
- package/src/providers/claude-code.js +465 -0
- package/src/providers/codex.js +168 -0
- package/src/providers/demo.js +1379 -0
- package/src/providers/gemini-cli.js +115 -0
- package/src/server.js +201 -0
- package/src/state.js +142 -0
- package/src/update.js +99 -0
- package/src/util.js +139 -0
- package/src/workspace.js +112 -0
|
@@ -0,0 +1,1379 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Demo provider: generates a live, deterministic fictional engineering afternoon at "Ledgerline Bank".
|
|
3
|
+
// Pure in-memory computation from `now` — never touches the filesystem, home folder, network or external commands.
|
|
4
|
+
const { SEC, MIN, HOUR, DAY, cut, Samples } = require('../util');
|
|
5
|
+
const { quotaWindowKey, quotaWindowLabel } = require('../history');
|
|
6
|
+
|
|
7
|
+
const ROOT = '/work/ledgerline';
|
|
8
|
+
const TOOL_META = [
|
|
9
|
+
{ id: 'claude-code', label: 'Claude Code' },
|
|
10
|
+
{ id: 'antigravity', label: 'Antigravity' },
|
|
11
|
+
{ id: 'codex', label: 'Codex' },
|
|
12
|
+
{ id: 'gemini-cli', label: 'Gemini CLI' },
|
|
13
|
+
];
|
|
14
|
+
const DEMO_PREFIXES = ['cc:', 'ag:', 'cx:', 'gc:'];
|
|
15
|
+
|
|
16
|
+
const PEOPLE = {
|
|
17
|
+
maya: { user: 'Maya Chen', account: 'maya.chen@ledgerline.example' },
|
|
18
|
+
daniel: { user: 'Daniel Okafor', account: 'daniel.okafor@ledgerline.example' },
|
|
19
|
+
sofia: { user: 'Sofia Romero', account: 'sofia.romero@ledgerline.example' },
|
|
20
|
+
ken: { user: 'Ken Tanaka', account: 'ken.tanaka@ledgerline.example' },
|
|
21
|
+
aylin: { user: 'Aylin Demir', account: 'aylin.demir@ledgerline.example' },
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const WORKSPACES = {
|
|
25
|
+
payments: { id: ROOT + '/payments-api', name: 'payments-api', path: ROOT + '/payments-api', top: ROOT + '/payments-api', branch: 'main', git: true },
|
|
26
|
+
mobile: { id: ROOT + '/mobile-app', name: 'mobile-app', path: ROOT + '/mobile-app', top: ROOT + '/mobile-app', branch: 'main', git: true },
|
|
27
|
+
risk: { id: ROOT + '/risk-models', name: 'risk-models', path: ROOT + '/risk-models', top: ROOT + '/risk-models', branch: 'main', git: true },
|
|
28
|
+
ledger: { id: ROOT + '/core-ledger', name: 'core-ledger', path: ROOT + '/core-ledger', top: ROOT + '/core-ledger', branch: 'main', git: true },
|
|
29
|
+
infra: { id: ROOT + '/infra', name: 'infra', path: ROOT + '/infra', top: ROOT + '/infra', branch: 'main', git: true },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const PAY_WAVES = [
|
|
33
|
+
{
|
|
34
|
+
name: 'api-docs', role: 'OpenAPI docs', model: 'claude-haiku-5-5',
|
|
35
|
+
task: 'Update OpenAPI 3.1 schema for /v2/settlements/batches and refund error codes',
|
|
36
|
+
files: [{ path: 'docs/openapi/settlements.yaml', op: 'edited' }, { path: 'docs/openapi/refunds.yaml', op: 'edited' }],
|
|
37
|
+
actions: [
|
|
38
|
+
{ tool: 'Read', arg: 'docs/openapi/settlements.yaml', res: 'Loaded 418 lines of OpenAPI 3.1 specification.' },
|
|
39
|
+
{ tool: 'Edit', arg: 'docs/openapi/settlements.yaml', res: 'Added Idempotency-Key header and 409 conflict schema.' },
|
|
40
|
+
{ tool: 'Edit', arg: 'docs/openapi/refunds.yaml', res: 'Documented partial_capture_expired error code.' },
|
|
41
|
+
{ tool: 'Bash', arg: 'npx spectral lint docs/openapi/*.yaml', res: '0 errors, 0 warnings across 2 documents.' },
|
|
42
|
+
],
|
|
43
|
+
result: 'Updated OpenAPI 3.1 specifications for settlement batches and refund errors; Spectral lint passed with 0 warnings.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'openapi-diff', role: 'contract check', model: 'claude-haiku-5-5',
|
|
47
|
+
task: 'Verify backward compatibility of /v2/settlements response payloads against partner SDKs',
|
|
48
|
+
files: [{ path: 'docs/openapi/settlements.yaml', op: 'edited' }, { path: 'tests/contract/partner-v2.test.ts', op: 'created' }],
|
|
49
|
+
actions: [
|
|
50
|
+
{ tool: 'Bash', arg: 'npx oasdiff breaking origin/main docs/openapi/settlements.yaml', res: 'No breaking changes detected.' },
|
|
51
|
+
{ tool: 'Write', arg: 'tests/contract/partner-v2.test.ts', res: 'Created 14 contract assertions.' },
|
|
52
|
+
{ tool: 'Bash', arg: 'npm test -- contract/partner-v2', res: '14 passed (0.8s).' },
|
|
53
|
+
],
|
|
54
|
+
result: 'Confirmed zero breaking OpenAPI changes and added 14 partner contract assertions.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'webhook-fuzz', role: 'retry fuzzing', model: 'claude-sonnet-5-5',
|
|
58
|
+
task: 'Fuzz out-of-order ACH settlement webhook deliveries and duplicate callback bursts',
|
|
59
|
+
files: [{ path: 'tests/settlement/webhook-order.test.ts', op: 'created' }],
|
|
60
|
+
actions: [
|
|
61
|
+
{ tool: 'Read', arg: 'src/settlement/webhooks.ts', res: 'Inspected state transition guard for settled -> reversed.' },
|
|
62
|
+
{ tool: 'Write', arg: 'tests/settlement/webhook-order.test.ts', res: 'Added 200 randomized delivery order permutations.' },
|
|
63
|
+
{ tool: 'Bash', arg: 'npm test -- webhook-order', res: '200/200 permutations converged to identical ledger state.' },
|
|
64
|
+
],
|
|
65
|
+
result: 'Verified webhook idempotency across 200 out-of-order delivery permutations.',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'audit-trail', role: 'compliance log', model: 'claude-haiku-5-5',
|
|
69
|
+
task: 'Ensure structured audit events record correlation_id and operator actor on manual retries',
|
|
70
|
+
files: [{ path: 'src/settlement/audit.ts', op: 'edited' }],
|
|
71
|
+
actions: [
|
|
72
|
+
{ tool: 'Grep', arg: 'emitAuditEvent src/settlement/', res: 'Found 6 call sites across batch.ts and retry.ts.' },
|
|
73
|
+
{ tool: 'Edit', arg: 'src/settlement/audit.ts', res: 'Included correlation_id and retry_attempt fields.' },
|
|
74
|
+
{ tool: 'Bash', arg: 'npm test -- settlement/audit', res: '11 passed (0.5s).' },
|
|
75
|
+
],
|
|
76
|
+
result: 'Added correlation_id and retry_attempt fields to all settlement audit events.',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const MOB_WAVES = [
|
|
81
|
+
{
|
|
82
|
+
name: 'a11y-audit', role: 'accessibility', model: 'gemini-4-flash',
|
|
83
|
+
task: 'Audit VoiceOver focus order and dynamic type scaling on TransferConfirm screen',
|
|
84
|
+
files: [{ path: 'src/screens/TransferConfirm.tsx', op: 'edited' }],
|
|
85
|
+
actions: [
|
|
86
|
+
{ tool: 'read_file', arg: 'src/screens/TransferConfirm.tsx', res: 'Checked accessibilityLabel and role props on 9 controls.' },
|
|
87
|
+
{ tool: 'edit_file', arg: 'src/screens/TransferConfirm.tsx', res: 'Grouped amount + currency into single accessible summary.' },
|
|
88
|
+
{ tool: 'run_command', arg: 'npm test -- TransferConfirm.a11y', res: 'All 12 accessibility assertions passed.' },
|
|
89
|
+
],
|
|
90
|
+
result: 'Fixed VoiceOver focus order and dynamic font wrapping on TransferConfirm.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'perf-profile', role: 'render budget', model: 'gemini-4-flash',
|
|
94
|
+
task: 'Check React Native re-render counts during biometric sheet open animation',
|
|
95
|
+
files: [{ path: 'src/components/BiometricSheet.tsx', op: 'edited' }],
|
|
96
|
+
actions: [
|
|
97
|
+
{ tool: 'read_file', arg: 'src/components/BiometricSheet.tsx', res: 'Found inline style object triggering 4 extra renders.' },
|
|
98
|
+
{ tool: 'edit_file', arg: 'src/components/BiometricSheet.tsx', res: 'Memoized sheet styles and callback refs.' },
|
|
99
|
+
{ tool: 'run_command', arg: 'npm test -- BiometricSheet.perf', res: 'Frame budget steady at 60 fps (1 commit on open).' },
|
|
100
|
+
],
|
|
101
|
+
result: 'Eliminated redundant re-renders in BiometricSheet; 60 fps verified.',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'snapshot-sync', role: 'UI snapshots', model: 'gemini-4-flash',
|
|
105
|
+
task: 'Refresh dark and light theme Jest snapshots for high-value transfer sheets',
|
|
106
|
+
files: [{ path: 'src/screens/__snapshots__/TransferConfirm.test.tsx.snap', op: 'edited' }],
|
|
107
|
+
actions: [
|
|
108
|
+
{ tool: 'run_command', arg: 'npx jest -u src/screens/TransferConfirm.test.tsx', res: 'Updated 4 snapshots (iOS/Android x light/dark).' },
|
|
109
|
+
{ tool: 'read_file', arg: 'src/screens/__snapshots__/TransferConfirm.test.tsx.snap', res: 'Verified expected biometric prompt copy and badge layout.' },
|
|
110
|
+
],
|
|
111
|
+
result: 'Updated and verified 4 platform/theme snapshots for TransferConfirm.',
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
// Deterministic pseudo-variation in [0.78, 1.24] with zero randomness.
|
|
116
|
+
function waveFactor(seed, step) {
|
|
117
|
+
const x = Math.sin(seed * 12.9898 + step * 78.233) * 43758.5453;
|
|
118
|
+
return 0.78 + (x - Math.floor(x)) * 0.46;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function hashId(str) {
|
|
122
|
+
let h = 2166136261;
|
|
123
|
+
for (let i = 0; i < str.length; i++) h = Math.imul(h ^ str.charCodeAt(i), 16777619);
|
|
124
|
+
return (h >>> 0) % 10000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function nextReset(anchorTs, windowMs, now) {
|
|
128
|
+
if (anchorTs > now) return anchorTs;
|
|
129
|
+
const steps = Math.floor((now - anchorTs) / windowMs) + 1;
|
|
130
|
+
return anchorTs + steps * windowMs;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Builds a monotonically growing Samples list and matching totals without floating bucket jitter.
|
|
134
|
+
// Pre-origin activity uses fixed coarse steps; post-origin activity uses exact `stepMs` steps,
|
|
135
|
+
// rolling completed minutes older than 10 min into 1-min aggregates whose sums match bit-for-bit.
|
|
136
|
+
function buildTimeline(seed, model, started, last, origin, stepMs, tokPerStep, now) {
|
|
137
|
+
const samples = new Samples();
|
|
138
|
+
const totals = { in: 0, cache: 0, out: 0 };
|
|
139
|
+
const add = (ts, tin, tc, tout) => {
|
|
140
|
+
totals.in += tin; totals.cache += tc; totals.out += tout;
|
|
141
|
+
samples.add(ts, model, tin, tc, tout);
|
|
142
|
+
};
|
|
143
|
+
const stepTokens = (idx) => {
|
|
144
|
+
const f = waveFactor(seed, idx);
|
|
145
|
+
return [
|
|
146
|
+
Math.round(tokPerStep.in * f),
|
|
147
|
+
Math.round(tokPerStep.cache * f),
|
|
148
|
+
Math.round(tokPerStep.out * f),
|
|
149
|
+
];
|
|
150
|
+
};
|
|
151
|
+
if (last < started) return { samples, totals, steps: 0 };
|
|
152
|
+
|
|
153
|
+
const preEnd = Math.min(last, origin);
|
|
154
|
+
let steps = 0;
|
|
155
|
+
if (preEnd >= started) {
|
|
156
|
+
const preDur = preEnd - started;
|
|
157
|
+
const coarseMs = preDur > 2 * HOUR ? 5 * MIN : preDur > 35 * MIN ? 2 * MIN : MIN;
|
|
158
|
+
const mult = Math.max(1, Math.round(coarseMs / stepMs));
|
|
159
|
+
let idx = 0;
|
|
160
|
+
for (let ts = started; ts <= preEnd; ts += coarseMs) {
|
|
161
|
+
const [tin, tc, tout] = stepTokens(idx);
|
|
162
|
+
const count = ts + coarseMs > preEnd ? Math.max(1, Math.round((preEnd - ts) / stepMs) || 1) : mult;
|
|
163
|
+
add(ts, tin * count, tc * count, tout * count);
|
|
164
|
+
steps += count;
|
|
165
|
+
idx++;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (last > origin) {
|
|
170
|
+
const liveStart = Math.max(origin + stepMs, started);
|
|
171
|
+
const totalLiveSteps = Math.max(0, Math.floor((last - liveStart) / stepMs) + 1);
|
|
172
|
+
const fineCutoff = Math.max(liveStart, Math.floor((now - 10 * MIN) / MIN) * MIN);
|
|
173
|
+
let aggMin = -1, aIn = 0, aCache = 0, aOut = 0, aTs = 0;
|
|
174
|
+
const flush = () => {
|
|
175
|
+
if (aggMin >= 0) { add(aTs, aIn, aCache, aOut); aggMin = -1; aIn = 0; aCache = 0; aOut = 0; }
|
|
176
|
+
};
|
|
177
|
+
for (let k = 0; k < totalLiveSteps; k++) {
|
|
178
|
+
const ts = liveStart + k * stepMs;
|
|
179
|
+
const [tin, tc, tout] = stepTokens(10000 + k);
|
|
180
|
+
steps++;
|
|
181
|
+
if (ts < fineCutoff) {
|
|
182
|
+
const m = Math.floor(ts / MIN);
|
|
183
|
+
if (m !== aggMin) { flush(); aggMin = m; aTs = ts; }
|
|
184
|
+
aIn += tin; aCache += tc; aOut += tout;
|
|
185
|
+
} else {
|
|
186
|
+
flush();
|
|
187
|
+
add(ts, tin, tc, tout);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
flush();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return { samples, totals, steps };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Static blueprint definitions for the Ledgerline Bank afternoon scenario.
|
|
197
|
+
function staticBlueprints() {
|
|
198
|
+
return [
|
|
199
|
+
// ================================================================ payments-api (Node)
|
|
200
|
+
{
|
|
201
|
+
id: 'cc:pay-lead', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
202
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.payments, branch: 'feat/ach-batch-retry', client: 'cli',
|
|
203
|
+
person: PEOPLE.maya, model: 'claude-opus-5-5', mode: 'working', stepSec: 4, ageMin: 46,
|
|
204
|
+
tok: { in: 1450, cache: 11200, out: 620 },
|
|
205
|
+
label: 'ACH batch settlement retry',
|
|
206
|
+
task: 'Add idempotency keys and exponential backoff to nightly ACH settlement batches',
|
|
207
|
+
files: [
|
|
208
|
+
{ path: 'src/settlement/batch.ts', op: 'edited' },
|
|
209
|
+
{ path: 'src/settlement/idempotency.ts', op: 'created' },
|
|
210
|
+
{ path: 'src/settlement/retry-policy.ts', op: 'edited' },
|
|
211
|
+
],
|
|
212
|
+
subCalls: [
|
|
213
|
+
{ tool: 'Agent', arg: 'test-runner: Run refund and partial-capture edge case tests', child: 'cc:pay-lead/agent-tests' },
|
|
214
|
+
{ tool: 'Agent', arg: 'migration-check: Verify zero-downtime Postgres idempotency index', child: 'cc:pay-lead/agent-migration' },
|
|
215
|
+
{ tool: 'Agent', arg: 'code-reviewer: Audit settlement retry handler for duplicate debits', child: 'cc:pay-lead/agent-review' },
|
|
216
|
+
],
|
|
217
|
+
actions: [
|
|
218
|
+
{ tool: 'Read', arg: 'src/settlement/batch.ts', res: 'Read 312 lines; batch loop lacks per-item idempotency guard.' },
|
|
219
|
+
{ tool: 'Write', arg: 'src/settlement/idempotency.ts', res: 'Created Postgres advisory lock + idempotency key store.' },
|
|
220
|
+
{ tool: 'Edit', arg: 'src/settlement/batch.ts', res: 'Wrapped ACH debit dispatch with exponential backoff + jitter.' },
|
|
221
|
+
{ tool: 'Bash', arg: 'npm test -- settlement/batch', res: '38 passed, 0 failed (2.4s).' },
|
|
222
|
+
{ tool: 'Edit', arg: 'src/settlement/retry-policy.ts', res: 'Capped retry window at 45 min with dead-letter escalation.' },
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'cc:pay-lead/agent-tests', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:pay-lead',
|
|
227
|
+
name: 'test-runner', role: 'unit tests', ws: WORKSPACES.payments, branch: 'feat/ach-batch-retry', client: 'cli',
|
|
228
|
+
person: PEOPLE.maya, model: 'claude-sonnet-5-5', mode: 'working', stepSec: 4, ageMin: 31,
|
|
229
|
+
tok: { in: 920, cache: 7800, out: 410 },
|
|
230
|
+
label: 'test-runner',
|
|
231
|
+
task: 'Run refund and partial-capture edge case tests for settlement batches',
|
|
232
|
+
files: [{ path: 'tests/settlement/refunds.test.ts', op: 'edited' }],
|
|
233
|
+
actions: [
|
|
234
|
+
{ tool: 'Read', arg: 'tests/settlement/refunds.test.ts', res: 'Loaded 18 refund test suites.' },
|
|
235
|
+
{ tool: 'Edit', arg: 'tests/settlement/refunds.test.ts', res: 'Added split-capture idempotency replay cases.' },
|
|
236
|
+
{ tool: 'Bash', arg: 'npm test -- refunds', res: '44 passed, 0 failed (3.1s).' },
|
|
237
|
+
{ tool: 'Bash', arg: 'npm test -- settlement/partial-capture', res: '19 passed, 0 failed (1.6s).' },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'cc:pay-lead/agent-migration', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:pay-lead',
|
|
242
|
+
name: 'migration-check', role: 'db migration', ws: WORKSPACES.payments, branch: 'feat/ach-batch-retry', client: 'cli',
|
|
243
|
+
person: PEOPLE.maya, model: 'claude-sonnet-5-5', mode: 'working', stepSec: 5, ageMin: 27,
|
|
244
|
+
tok: { in: 860, cache: 6400, out: 350 },
|
|
245
|
+
label: 'migration-check',
|
|
246
|
+
task: 'Verify zero-downtime Postgres migration for idempotency_keys concurrent index',
|
|
247
|
+
files: [{ path: 'db/migrations/20261206_idempotency_idx.sql', op: 'created' }],
|
|
248
|
+
actions: [
|
|
249
|
+
{ tool: 'Read', arg: 'db/migrations/20261206_idempotency_idx.sql', res: 'Verified CREATE INDEX CONCURRENTLY without table lock.' },
|
|
250
|
+
{ tool: 'Bash', arg: 'npm run db:lint -- db/migrations/20261206_idempotency_idx.sql', res: 'squawk: 0 lock-safety violations.' },
|
|
251
|
+
{ tool: 'Edit', arg: 'db/migrations/20261206_idempotency_idx.sql', res: 'Added rollback DROP INDEX CONCURRENTLY IF EXISTS.' },
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: 'cc:pay-lead/agent-review', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:pay-lead',
|
|
256
|
+
name: 'code-reviewer', role: 'security review', ws: WORKSPACES.payments, branch: 'feat/ach-batch-retry', client: 'cli',
|
|
257
|
+
person: PEOPLE.maya, model: 'claude-haiku-5-5', mode: 'working', stepSec: 5, ageMin: 22,
|
|
258
|
+
tok: { in: 740, cache: 5200, out: 290 },
|
|
259
|
+
label: 'code-reviewer',
|
|
260
|
+
task: 'Audit settlement retry handler for duplicate debit race conditions and PII leaks',
|
|
261
|
+
files: [{ path: 'src/settlement/batch.ts', op: 'edited' }],
|
|
262
|
+
actions: [
|
|
263
|
+
{ tool: 'Grep', arg: 'acquireSettlementLock src/settlement/', res: '3 lock acquisitions checked; all release in finally.' },
|
|
264
|
+
{ tool: 'Read', arg: 'src/settlement/idempotency.ts', res: 'Verified SHA-256 hashing of routing + account tokens.' },
|
|
265
|
+
{ tool: 'Grep', arg: 'logger.info src/settlement/', res: 'Confirmed IBAN and account numbers are masked.' },
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: 'cx:pay-fraud', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
270
|
+
name: 'Codex', role: '', ws: WORKSPACES.payments, branch: 'fix/velocity-fraud-rule', client: 'cli',
|
|
271
|
+
person: PEOPLE.aylin, model: 'gpt-5.5-codex', mode: 'working', stepSec: 4, ageMin: 42,
|
|
272
|
+
tok: { in: 1320, cache: 9600, out: 540 },
|
|
273
|
+
label: 'Velocity fraud-rule fix',
|
|
274
|
+
task: 'Fix sliding-window velocity threshold bug for cross-border wire transfers',
|
|
275
|
+
files: [
|
|
276
|
+
{ path: 'src/fraud/velocity.ts', op: 'edited' },
|
|
277
|
+
{ path: 'tests/fraud/velocity.test.ts', op: 'edited' },
|
|
278
|
+
],
|
|
279
|
+
actions: [
|
|
280
|
+
{ tool: 'shell', arg: 'rg -n "windowMs" src/fraud/', res: 'Found off-by-one boundary check at src/fraud/velocity.ts:88.' },
|
|
281
|
+
{ tool: 'apply_patch', arg: 'src/fraud/velocity.ts', res: 'Switched to inclusive rolling 60-minute Redis ZRANGEBYSCORE.' },
|
|
282
|
+
{ tool: 'shell', arg: 'npm test -- fraud-velocity', res: '27 passed, 0 failed (1.9s).' },
|
|
283
|
+
{ tool: 'apply_patch', arg: 'tests/fraud/velocity.test.ts', res: 'Added UTC midnight rollover and FX conversion test cases.' },
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: 'cc:pay-perm', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
288
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.payments, branch: 'feat/refund-webhooks', client: 'ide',
|
|
289
|
+
person: PEOPLE.maya, model: 'claude-sonnet-5-5', mode: 'stall-a', stepSec: 4, ageMin: 36,
|
|
290
|
+
tok: { in: 1080, cache: 8100, out: 430 },
|
|
291
|
+
label: 'Refund webhook dry-run',
|
|
292
|
+
task: 'Run staging dry-run for dead-letter refund webhook replay script',
|
|
293
|
+
files: [{ path: 'scripts/replay-refunds.sql', op: 'edited' }],
|
|
294
|
+
stalledAction: 'Bash: psql $STAGING_DB -f scripts/replay-refunds.sql --dry-run (permission prompt)',
|
|
295
|
+
actions: [
|
|
296
|
+
{ tool: 'Read', arg: 'scripts/replay-refunds.sql', res: 'Reviewed 64-line transaction wrapped in ROLLBACK.' },
|
|
297
|
+
{ tool: 'Edit', arg: 'scripts/replay-refunds.sql', res: 'Added LIMIT 500 safety cap and dry-run summary SELECT.' },
|
|
298
|
+
{ tool: 'Bash', arg: 'psql $STAGING_DB -f scripts/replay-refunds.sql --dry-run', res: 'Dry-run matched 142 dead-letter refund webhooks; 0 conflicts.' },
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: 'cx:pay-build-err', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
303
|
+
name: 'Codex', role: '', ws: WORKSPACES.payments, branch: 'chore/node22-upgrade', client: 'cli',
|
|
304
|
+
person: PEOPLE.aylin, model: 'gpt-5.5-codex', mode: 'failed', stepSec: 5, ageMin: 38, endedMin: 16,
|
|
305
|
+
tok: { in: 1100, cache: 7200, out: 460 },
|
|
306
|
+
label: 'Node 22 TypeScript upgrade',
|
|
307
|
+
task: 'Upgrade payments-api build toolchain to Node 22 and TypeScript 5.8',
|
|
308
|
+
files: [{ path: 'package.json', op: 'edited' }, { path: 'tsconfig.json', op: 'edited' }],
|
|
309
|
+
failAction: 'shell: npm run build (TS2345 in src/iso20022/parser.ts)',
|
|
310
|
+
failText: "src/iso20022/parser.ts(142,19): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'IsoCurrencyCode'.",
|
|
311
|
+
actions: [
|
|
312
|
+
{ tool: 'apply_patch', arg: 'tsconfig.json', res: 'Enabled strictBuiltinIteratorReturn for TS 5.8.' },
|
|
313
|
+
{ tool: 'shell', arg: 'npm run build', res: 'Build failed with 1 TypeScript error in src/iso20022/parser.ts.' },
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: 'cc:pay-done-1', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
318
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.payments, branch: 'fix/sepa-rounding', client: 'cli',
|
|
319
|
+
person: PEOPLE.maya, model: 'claude-sonnet-5-5', mode: 'done', stepSec: 5, ageMin: 185, endedMin: 118,
|
|
320
|
+
tok: { in: 1150, cache: 8900, out: 480 },
|
|
321
|
+
label: 'SEPA cent rounding fix',
|
|
322
|
+
task: 'Fix half-even rounding mismatch on multi-currency SEPA payout fees',
|
|
323
|
+
files: [{ path: 'src/settlement/currency.ts', op: 'edited' }, { path: 'tests/settlement/sepa-rounding.test.ts', op: 'created' }],
|
|
324
|
+
actions: [
|
|
325
|
+
{ tool: 'Edit', arg: 'src/settlement/currency.ts', res: 'Switched fee split to BigInt minor units with banker rounding.' },
|
|
326
|
+
{ tool: 'Bash', arg: 'npm test -- sepa-rounding', res: '32 passed, 0 failed.' },
|
|
327
|
+
],
|
|
328
|
+
result: 'Replaced floating-point fee allocation with BigInt minor-unit banker rounding across all SEPA corridors.',
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: 'cx:pay-done-2', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
332
|
+
name: 'Codex', role: '', ws: WORKSPACES.payments, branch: 'chore/iso8583-fixtures', client: 'cli',
|
|
333
|
+
person: PEOPLE.aylin, model: 'gpt-5.5-mini', mode: 'done', stepSec: 5, ageMin: 310, endedMin: 215,
|
|
334
|
+
tok: { in: 820, cache: 5400, out: 340 },
|
|
335
|
+
label: 'ISO-8583 auth fixtures',
|
|
336
|
+
task: 'Generate deterministic ISO-8583 authorization and reversal test fixtures',
|
|
337
|
+
files: [{ path: 'tests/fixtures/iso8583-auth.json', op: 'created' }],
|
|
338
|
+
actions: [
|
|
339
|
+
{ tool: 'shell', arg: 'node scripts/gen-iso8583-fixtures.js', res: 'Wrote 48 deterministic card auth fixtures.' },
|
|
340
|
+
{ tool: 'shell', arg: 'npm test -- iso8583', res: '48 passed, 0 failed.' },
|
|
341
|
+
],
|
|
342
|
+
result: 'Generated 48 deterministic ISO-8583 auth and reversal fixtures and verified parser coverage.',
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
// ================================================================ mobile-app (React Native)
|
|
346
|
+
{
|
|
347
|
+
id: 'ag:mob-lead', provider: 'antigravity', tool: 'Antigravity', kind: 'session', parent: null,
|
|
348
|
+
name: 'Antigravity', role: '', ws: WORKSPACES.mobile, branch: 'feat/biometric-transfer', client: 'cli',
|
|
349
|
+
person: PEOPLE.daniel, model: 'gemini-4-pro', mode: 'working', stepSec: 4, ageMin: 52,
|
|
350
|
+
tok: { in: 1520, cache: 10800, out: 640 },
|
|
351
|
+
label: 'Biometric transfer flow',
|
|
352
|
+
task: 'Implement FaceID/TouchID confirmation sheet for transfers over $1,000',
|
|
353
|
+
files: [
|
|
354
|
+
{ path: 'src/screens/TransferConfirm.tsx', op: 'edited' },
|
|
355
|
+
{ path: 'src/services/biometrics.ts', op: 'created' },
|
|
356
|
+
],
|
|
357
|
+
subCalls: [
|
|
358
|
+
{ tool: 'invoke_subagent', arg: 'ui-components: Build accessible biometric bottom-sheet stepper', child: 'ag:mob-ui' },
|
|
359
|
+
{ tool: 'invoke_subagent', arg: 'detox-tests: Add iOS and Android biometric e2e mocks', child: 'ag:mob-e2e' },
|
|
360
|
+
],
|
|
361
|
+
actions: [
|
|
362
|
+
{ tool: 'read_file', arg: 'src/screens/TransferConfirm.tsx', res: 'Inspected transfer limit guard and PIN fallback path.' },
|
|
363
|
+
{ tool: 'write_file', arg: 'src/services/biometrics.ts', res: 'Wrapped LocalAuthentication with hardware key attestation.' },
|
|
364
|
+
{ tool: 'edit_file', arg: 'src/screens/TransferConfirm.tsx', res: 'Wired BiometricSheet trigger for amounts >= $1,000.' },
|
|
365
|
+
{ tool: 'run_command', arg: 'npm test -- TransferConfirm', res: '22 passed, 0 failed (2.1s).' },
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: 'ag:mob-ui', provider: 'antigravity', tool: 'Antigravity', kind: 'subagent', parent: 'ag:mob-lead',
|
|
370
|
+
name: 'ui-components', role: 'RN layout', ws: WORKSPACES.mobile, branch: 'feat/biometric-transfer', client: 'cli',
|
|
371
|
+
person: PEOPLE.daniel, model: 'gemini-4-neon-high', mode: 'working', stepSec: 4, ageMin: 34,
|
|
372
|
+
tok: { in: 1120, cache: 8400, out: 510 },
|
|
373
|
+
label: 'ui-components',
|
|
374
|
+
task: 'Build accessible bottom-sheet stepper and haptic feedback hook for biometric auth',
|
|
375
|
+
files: [{ path: 'src/components/BiometricSheet.tsx', op: 'created' }, { path: 'src/hooks/useHaptics.ts', op: 'created' }],
|
|
376
|
+
actions: [
|
|
377
|
+
{ tool: 'write_file', arg: 'src/components/BiometricSheet.tsx', res: 'Created spring-animated bottom sheet with PIN fallback.' },
|
|
378
|
+
{ tool: 'edit_file', arg: 'src/components/BiometricSheet.tsx', res: 'Added reduced-motion fade fallback.' },
|
|
379
|
+
{ tool: 'write_file', arg: 'src/hooks/useHaptics.ts', res: 'Mapped success/warning haptic pulses for iOS and Android.' },
|
|
380
|
+
],
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
id: 'ag:mob-e2e', provider: 'antigravity', tool: 'Antigravity', kind: 'subagent', parent: 'ag:mob-lead',
|
|
384
|
+
name: 'detox-tests', role: 'e2e tests', ws: WORKSPACES.mobile, branch: 'feat/biometric-transfer', client: 'cli',
|
|
385
|
+
person: PEOPLE.daniel, model: 'gemini-4-flash', mode: 'working', stepSec: 5, ageMin: 25,
|
|
386
|
+
tok: { in: 840, cache: 5900, out: 360 },
|
|
387
|
+
label: 'detox-tests',
|
|
388
|
+
task: 'Add Detox biometric prompt mocks for iOS Simulator and Android emulator',
|
|
389
|
+
files: [{ path: 'e2e/transfer-biometric.e2e.ts', op: 'created' }],
|
|
390
|
+
actions: [
|
|
391
|
+
{ tool: 'write_file', arg: 'e2e/transfer-biometric.e2e.ts', res: 'Added FaceID match, cancel, and lockout fallback flows.' },
|
|
392
|
+
{ tool: 'run_command', arg: 'npx detox test e2e/transfer-biometric.e2e.ts', res: '6/6 Detox scenarios green on iOS 18 simulator.' },
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: 'gc:mob-i18n', provider: 'gemini-cli', tool: 'Gemini CLI', kind: 'session', parent: null,
|
|
397
|
+
name: 'Gemini CLI', role: '', ws: WORKSPACES.mobile, branch: 'feat/i18n-eu-launch', client: 'cli',
|
|
398
|
+
person: PEOPLE.daniel, model: 'gemini-4-flash', mode: 'working', stepSec: 4, ageMin: 64,
|
|
399
|
+
tok: { in: 1180, cache: 7600, out: 590 },
|
|
400
|
+
label: 'EU locale translations',
|
|
401
|
+
task: 'Translate onboarding and card-freeze strings into DE, FR, ES and TR locales',
|
|
402
|
+
files: [
|
|
403
|
+
{ path: 'locales/de/cards.json', op: 'edited' },
|
|
404
|
+
{ path: 'locales/fr/cards.json', op: 'edited' },
|
|
405
|
+
{ path: 'locales/tr/cards.json', op: 'edited' },
|
|
406
|
+
],
|
|
407
|
+
actions: [
|
|
408
|
+
{ tool: 'read_file', arg: 'locales/en/cards.json', res: 'Loaded 128 source keys with ICU plural rules.' },
|
|
409
|
+
{ tool: 'write_file', arg: 'locales/de/cards.json', res: 'Translated 128 keys; checked formal Sie register.' },
|
|
410
|
+
{ tool: 'write_file', arg: 'locales/tr/cards.json', res: 'Translated 128 keys; verified Turkish dotted/dotless I.' },
|
|
411
|
+
{ tool: 'run_command', arg: 'npm run i18n:verify', res: '0 missing keys, 0 ICU syntax errors across 5 locales.' },
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: 'cc:mob-push', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
416
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.mobile, branch: 'fix/ios-push-badge', client: 'ide',
|
|
417
|
+
person: PEOPLE.maya, model: 'claude-sonnet-5-5', mode: 'idle', stepSec: 5, ageMin: 44,
|
|
418
|
+
tok: { in: 940, cache: 6800, out: 380 },
|
|
419
|
+
label: 'iOS push badge counter',
|
|
420
|
+
task: 'Reconcile unread transaction notification badge count on foreground resume',
|
|
421
|
+
files: [{ path: 'ios/Ledgerline/NotificationService.swift', op: 'edited' }],
|
|
422
|
+
actions: [
|
|
423
|
+
{ tool: 'Read', arg: 'ios/Ledgerline/NotificationService.swift', res: 'Found shared AppGroup UserDefaults counter drift.' },
|
|
424
|
+
{ tool: 'Edit', arg: 'ios/Ledgerline/NotificationService.swift', res: 'Synced badge count from server unread_count payload.' },
|
|
425
|
+
],
|
|
426
|
+
idleAnswer: 'Updated NotificationService.swift to sync the badge from unread_count. Should we also clear stale badges on sign-out?',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
id: 'ag:mob-done-1', provider: 'antigravity', tool: 'Antigravity', kind: 'session', parent: null,
|
|
430
|
+
name: 'Antigravity', role: '', ws: WORKSPACES.mobile, branch: 'fix/offline-cache', client: 'cli',
|
|
431
|
+
person: PEOPLE.daniel, model: 'gemini-4-pro', mode: 'done', stepSec: 5, ageMin: 210, endedMin: 112,
|
|
432
|
+
tok: { in: 1240, cache: 8800, out: 510 },
|
|
433
|
+
label: 'Offline balance cache',
|
|
434
|
+
task: 'Encrypt cached account balances in MMKV when device locks',
|
|
435
|
+
files: [{ path: 'src/storage/secureCache.ts', op: 'edited' }],
|
|
436
|
+
actions: [
|
|
437
|
+
{ tool: 'edit_file', arg: 'src/storage/secureCache.ts', res: 'Rotated MMKV encryption key via Keychain/Keystore.' },
|
|
438
|
+
{ tool: 'run_command', arg: 'npm test -- secureCache', res: '18 passed, 0 failed.' },
|
|
439
|
+
],
|
|
440
|
+
result: 'Enabled Keychain-backed MMKV encryption and automatic memory wipe on background lock.',
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
id: 'gc:mob-done-2', provider: 'gemini-cli', tool: 'Gemini CLI', kind: 'session', parent: null,
|
|
444
|
+
name: 'Gemini CLI', role: '', ws: WORKSPACES.mobile, branch: 'chore/svg-icons', client: 'cli',
|
|
445
|
+
person: PEOPLE.daniel, model: 'gemini-4-flash', mode: 'done', stepSec: 5, ageMin: 340, endedMin: 235,
|
|
446
|
+
tok: { in: 780, cache: 4900, out: 310 },
|
|
447
|
+
label: 'Bank icon sprite cleanup',
|
|
448
|
+
task: 'Optimize 42 payment method SVG icons and strip unused clip masks',
|
|
449
|
+
files: [{ path: 'assets/icons/payments/index.ts', op: 'edited' }],
|
|
450
|
+
actions: [
|
|
451
|
+
{ tool: 'run_command', arg: 'npx svgo -f assets/icons/payments', res: 'Reduced total SVG bundle size by 41% (68 KB -> 40 KB).' },
|
|
452
|
+
],
|
|
453
|
+
result: 'Optimized 42 payment SVGs and reduced mobile icon bundle by 41%.',
|
|
454
|
+
},
|
|
455
|
+
|
|
456
|
+
// ================================================================ risk-models (Python)
|
|
457
|
+
{
|
|
458
|
+
id: 'cc:risk-backtest', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
459
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.risk, branch: 'exp/pd-v4-calibration', client: 'cli',
|
|
460
|
+
person: PEOPLE.sofia, model: 'claude-opus-5-5', mode: 'working', stepSec: 4, ageMin: 165,
|
|
461
|
+
tok: { in: 1620, cache: 13400, out: 680 },
|
|
462
|
+
label: 'PD v4 backtest pipeline',
|
|
463
|
+
task: 'Run 36-month probability-of-default calibration and PSI drift report on SMB cohorts',
|
|
464
|
+
files: [
|
|
465
|
+
{ path: 'models/pd.py', op: 'edited' },
|
|
466
|
+
{ path: 'pipelines/backtest_v4.py', op: 'edited' },
|
|
467
|
+
{ path: 'reports/pd_v4_psi.json', op: 'created' },
|
|
468
|
+
],
|
|
469
|
+
subCalls: [
|
|
470
|
+
{ tool: 'Agent', arg: 'feature-store: Compute 90-day cashflow volatility features', child: 'cc:risk-backtest/agent-features' },
|
|
471
|
+
],
|
|
472
|
+
actions: [
|
|
473
|
+
{ tool: 'read_file', arg: 'models/pd.py', res: 'Checked isotonic calibration spline knots and monotonicity.' },
|
|
474
|
+
{ tool: 'Edit', arg: 'models/pd.py', res: 'Pinned regularization C=0.45 for thin-file SMB segments.' },
|
|
475
|
+
{ tool: 'Bash', arg: 'python pipelines/backtest_v4.py --months 36 --out reports/pd_v4_psi.json', res: 'AUC 0.842, KS 0.518, PSI 0.041 (within green threshold).' },
|
|
476
|
+
{ tool: 'Bash', arg: 'pytest tests/test_pd_calibration.py', res: '29 passed in 4.6s.' },
|
|
477
|
+
],
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
id: 'cc:risk-backtest/agent-features', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:risk-backtest',
|
|
481
|
+
name: 'feature-store', role: 'feature eng', ws: WORKSPACES.risk, branch: 'exp/pd-v4-calibration', client: 'cli',
|
|
482
|
+
person: PEOPLE.sofia, model: 'claude-sonnet-5-5', mode: 'working', stepSec: 5, ageMin: 58,
|
|
483
|
+
tok: { in: 980, cache: 7400, out: 390 },
|
|
484
|
+
label: 'feature-store',
|
|
485
|
+
task: 'Compute 90-day cashflow volatility features from anonymized ledger snapshots',
|
|
486
|
+
files: [{ path: 'features/cashflow.py', op: 'edited' }],
|
|
487
|
+
actions: [
|
|
488
|
+
{ tool: 'Edit', arg: 'features/cashflow.py', res: 'Added rolling 90d inflow-to-outflow ratio with winsorization.' },
|
|
489
|
+
{ tool: 'Bash', arg: 'pytest tests/test_cashflow_features.py', res: '16 passed in 1.8s.' },
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: 'gc:risk-explain', provider: 'gemini-cli', tool: 'Gemini CLI', kind: 'session', parent: null,
|
|
494
|
+
name: 'Gemini CLI', role: '', ws: WORKSPACES.risk, branch: 'feat/shap-adverse-action', client: 'cli',
|
|
495
|
+
person: PEOPLE.sofia, model: 'gemini-4-pro', mode: 'idle', stepSec: 5, ageMin: 48,
|
|
496
|
+
tok: { in: 1120, cache: 7900, out: 470 },
|
|
497
|
+
label: 'SHAP adverse-action codes',
|
|
498
|
+
task: 'Map top-4 SHAP feature attributions to Reg-B adverse action reason codes',
|
|
499
|
+
files: [{ path: 'explainability/reason_codes.py', op: 'edited' }],
|
|
500
|
+
actions: [
|
|
501
|
+
{ tool: 'read_file', arg: 'explainability/reason_codes.py', res: 'Reviewed 24 compliance-approved adverse action templates.' },
|
|
502
|
+
{ tool: 'write_file', arg: 'explainability/reason_codes.py', res: 'Mapped cashflow volatility and utilization buckets to codes R12/R19.' },
|
|
503
|
+
],
|
|
504
|
+
idleAnswer: 'Mapped all 24 SHAP feature buckets to Reg-B reason codes. Please confirm whether thin-file applicants should use code R04 or R08 as fallback.',
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
id: 'cx:risk-sql', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
508
|
+
name: 'Codex', role: '', ws: WORKSPACES.risk, branch: 'fix/vintage-cohort-sql', client: 'cli',
|
|
509
|
+
person: PEOPLE.sofia, model: 'gpt-5.5-codex', mode: 'working', stepSec: 4, ageMin: 76,
|
|
510
|
+
tok: { in: 1210, cache: 8800, out: 490 },
|
|
511
|
+
label: 'Vintage cohort SQL fix',
|
|
512
|
+
task: 'Eliminate lookahead bias in delinquency cohort DuckDB extraction query',
|
|
513
|
+
files: [{ path: 'sql/vintage_cohorts.sql', op: 'edited' }, { path: 'tests/test_cohorts.py', op: 'edited' }],
|
|
514
|
+
actions: [
|
|
515
|
+
{ tool: 'apply_patch', arg: 'sql/vintage_cohorts.sql', res: 'Bounded feature join to snapshot_at <= origination_ts.' },
|
|
516
|
+
{ tool: 'shell', arg: 'python -m pytest tests/test_cohorts.py', res: '21 passed; 0 future-leak assertions triggered.' },
|
|
517
|
+
],
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
id: 'ag:risk-notebook', provider: 'antigravity', tool: 'Antigravity', kind: 'session', parent: null,
|
|
521
|
+
name: 'Antigravity', role: '', ws: WORKSPACES.risk, branch: 'exp/credit-limit-sim', client: 'runner',
|
|
522
|
+
person: PEOPLE.sofia, model: 'gemini-4-neon-high', mode: 'working', stepSec: 4, ageMin: 98,
|
|
523
|
+
tok: { in: 1380, cache: 9400, out: 580 },
|
|
524
|
+
label: 'Credit limit Monte Carlo',
|
|
525
|
+
task: 'Simulate tail-loss distribution across 50k synthetic SME credit line scenarios',
|
|
526
|
+
files: [{ path: 'jobs/monte_carlo.py', op: 'edited' }, { path: 'reports/tail_loss_p99.csv', op: 'created' }],
|
|
527
|
+
actions: [
|
|
528
|
+
{ tool: 'read_file', arg: 'jobs/monte_carlo.py', res: 'Verified vectorized NumPy copula correlation matrix.' },
|
|
529
|
+
{ tool: 'run_command', arg: 'python jobs/monte_carlo.py --scenarios 50000', res: 'VaR(99.5%): 3.12% of exposure; completed in 11.4s.' },
|
|
530
|
+
{ tool: 'edit_file', arg: 'jobs/monte_carlo.py', res: 'Added macro stress shock (+250 bps rate scenario).' },
|
|
531
|
+
],
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
id: 'cc:risk-done-1', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
535
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.risk, branch: 'chore/pydantic-v2', client: 'cli',
|
|
536
|
+
person: PEOPLE.sofia, model: 'claude-sonnet-5-5', mode: 'done', stepSec: 5, ageMin: 235, endedMin: 145,
|
|
537
|
+
tok: { in: 1020, cache: 7600, out: 410 },
|
|
538
|
+
label: 'Scoring schema Pydantic v2',
|
|
539
|
+
task: 'Migrate credit scoring request and response validators to Pydantic v2',
|
|
540
|
+
files: [{ path: 'api/schemas.py', op: 'edited' }],
|
|
541
|
+
actions: [
|
|
542
|
+
{ tool: 'Edit', arg: 'api/schemas.py', res: 'Replaced @validator with @field_validator and ConfigDict.' },
|
|
543
|
+
{ tool: 'Bash', arg: 'pytest tests/test_schemas.py', res: '34 passed in 0.9s.' },
|
|
544
|
+
],
|
|
545
|
+
result: 'Migrated all scoring API schemas to Pydantic v2; validation latency dropped 2.8x.',
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
id: 'gc:risk-done-2', provider: 'gemini-cli', tool: 'Gemini CLI', kind: 'session', parent: null,
|
|
549
|
+
name: 'Gemini CLI', role: '', ws: WORKSPACES.risk, branch: 'docs/model-card-v4', client: 'cli',
|
|
550
|
+
person: PEOPLE.sofia, model: 'gemini-4-flash', mode: 'done', stepSec: 5, ageMin: 350, endedMin: 252,
|
|
551
|
+
tok: { in: 890, cache: 5600, out: 420 },
|
|
552
|
+
label: 'Model risk card draft',
|
|
553
|
+
task: 'Generate SR 11-7 validation summary tables for Credit Committee review',
|
|
554
|
+
files: [{ path: 'docs/model-cards/pd-v4.md', op: 'created' }],
|
|
555
|
+
actions: [
|
|
556
|
+
{ tool: 'write_file', arg: 'docs/model-cards/pd-v4.md', res: 'Generated governance tables, lift charts, and drift bounds.' },
|
|
557
|
+
],
|
|
558
|
+
result: 'Drafted SR 11-7 model card for PD v4 with calibration and segment stability tables.',
|
|
559
|
+
},
|
|
560
|
+
|
|
561
|
+
// ================================================================ core-ledger (Go, 3-level subagent tree)
|
|
562
|
+
{
|
|
563
|
+
id: 'cc:led-root', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
564
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.ledger, branch: 'feat/double-entry-sharding', client: 'cli',
|
|
565
|
+
person: PEOPLE.ken, model: 'claude-opus-5-5', mode: 'waiting-parent', stepSec: 5, ageMin: 62,
|
|
566
|
+
tok: { in: 1580, cache: 12600, out: 640 },
|
|
567
|
+
label: 'Double-entry journal sharding',
|
|
568
|
+
task: 'Partition append-only double-entry journal by tenant shard with strict serializability',
|
|
569
|
+
files: [{ path: 'internal/journal/shard_router.go', op: 'created' }],
|
|
570
|
+
subCalls: [
|
|
571
|
+
{ tool: 'Agent', arg: 'posting-engine: Implement shard-aware journal writer', child: 'cc:led-root/agent-posting' },
|
|
572
|
+
{ tool: 'Agent', arg: 'p99-bench: Profile WAL fsync batching under 15k TPS', child: 'cc:led-root/agent-bench' },
|
|
573
|
+
],
|
|
574
|
+
actions: [
|
|
575
|
+
{ tool: 'Read', arg: 'internal/journal/ledger.go', res: 'Mapped global mutex contention across tenant postings.' },
|
|
576
|
+
{ tool: 'Write', arg: 'internal/journal/shard_router.go', res: 'Implemented consistent-hash tenant shard router.' },
|
|
577
|
+
],
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
id: 'cc:led-root/agent-posting', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:led-root',
|
|
581
|
+
name: 'posting-engine', role: 'Go core', ws: WORKSPACES.ledger, branch: 'feat/double-entry-sharding', client: 'cli',
|
|
582
|
+
person: PEOPLE.ken, model: 'claude-sonnet-5-5', mode: 'working', stepSec: 4, ageMin: 48,
|
|
583
|
+
tok: { in: 1120, cache: 8900, out: 480 },
|
|
584
|
+
label: 'posting-engine',
|
|
585
|
+
task: 'Implement shard-aware journal writer and balanced-entry invariant checks',
|
|
586
|
+
files: [{ path: 'internal/journal/writer.go', op: 'edited' }, { path: 'internal/journal/balance.go', op: 'edited' }],
|
|
587
|
+
subCalls: [
|
|
588
|
+
{ tool: 'Agent', arg: 'invariant-fuzzer: Fuzz concurrent multi-currency zero-sum invariant', child: 'cc:led-root/agent-posting-fuzz' },
|
|
589
|
+
],
|
|
590
|
+
actions: [
|
|
591
|
+
{ tool: 'Edit', arg: 'internal/journal/writer.go', res: 'Added per-shard WAL append channel with ordered sequence IDs.' },
|
|
592
|
+
{ tool: 'Edit', arg: 'internal/journal/balance.go', res: 'Enforced sum(debits) == sum(credits) per currency pre-commit.' },
|
|
593
|
+
{ tool: 'Bash', arg: 'go test -race ./internal/journal/...', res: 'ok ledgerline/core-ledger/internal/journal 1.94s.' },
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
id: 'cc:led-root/agent-posting-fuzz', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:led-root/agent-posting',
|
|
598
|
+
name: 'invariant-fuzzer', role: 'Go fuzzing', ws: WORKSPACES.ledger, branch: 'feat/double-entry-sharding', client: 'cli',
|
|
599
|
+
person: PEOPLE.ken, model: 'claude-haiku-5-5', mode: 'working', stepSec: 3, ageMin: 24,
|
|
600
|
+
tok: { in: 690, cache: 4800, out: 270 },
|
|
601
|
+
label: 'invariant-fuzzer',
|
|
602
|
+
task: 'Fuzz concurrent multi-currency transfers to verify zero-sum ledger invariant',
|
|
603
|
+
files: [{ path: 'internal/journal/fuzz_test.go', op: 'created' }],
|
|
604
|
+
actions: [
|
|
605
|
+
{ tool: 'Write', arg: 'internal/journal/fuzz_test.go', res: 'Created FuzzZeroSum with 16 concurrent goroutine workers.' },
|
|
606
|
+
{ tool: 'Bash', arg: 'go test -fuzz=FuzzZeroSum -fuzztime=20s ./internal/journal/...', res: '184,220 execs, 0 invariant violations.' },
|
|
607
|
+
{ tool: 'Edit', arg: 'internal/journal/fuzz_test.go', res: 'Added crash-recovery replay step between transfer batches.' },
|
|
608
|
+
],
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
id: 'cc:led-root/agent-bench', provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:led-root',
|
|
612
|
+
name: 'p99-bench', role: 'benchmarks', ws: WORKSPACES.ledger, branch: 'feat/double-entry-sharding', client: 'cli',
|
|
613
|
+
person: PEOPLE.ken, model: 'claude-sonnet-5-5', mode: 'working', stepSec: 5, ageMin: 35,
|
|
614
|
+
tok: { in: 910, cache: 6700, out: 360 },
|
|
615
|
+
label: 'p99-bench',
|
|
616
|
+
task: 'Profile WAL fsync batching latency under 15k TPS synthetic posting load',
|
|
617
|
+
files: [{ path: 'internal/wal/bench_test.go', op: 'edited' }],
|
|
618
|
+
actions: [
|
|
619
|
+
{ tool: 'Bash', arg: 'go test -bench=BenchmarkCommitWAL -benchmem ./internal/wal', res: '17,420 ops/s, p99=2.3ms, 0 allocs/op on hot path.' },
|
|
620
|
+
{ tool: 'Edit', arg: 'internal/wal/bench_test.go', res: 'Added 8-shard vs 16-shard comparative benchmark table.' },
|
|
621
|
+
],
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
id: 'cc:led-done-1', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
625
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.ledger, branch: 'fix/wal-crc32', client: 'cli',
|
|
626
|
+
person: PEOPLE.ken, model: 'claude-sonnet-5-5', mode: 'done', stepSec: 5, ageMin: 205, endedMin: 126,
|
|
627
|
+
tok: { in: 1080, cache: 8200, out: 430 },
|
|
628
|
+
label: 'WAL CRC32 checksum fix',
|
|
629
|
+
task: 'Fix torn-tail recovery checksum validation on ledger WAL segment rollover',
|
|
630
|
+
files: [{ path: 'internal/wal/recovery.go', op: 'edited' }],
|
|
631
|
+
actions: [
|
|
632
|
+
{ tool: 'Edit', arg: 'internal/wal/recovery.go', res: 'Truncated partial frame cleanly when CRC32 mismatch hits EOF.' },
|
|
633
|
+
{ tool: 'Bash', arg: 'go test ./internal/wal/...', res: 'ok ledgerline/core-ledger/internal/wal 0.88s.' },
|
|
634
|
+
],
|
|
635
|
+
result: 'Fixed torn-tail WAL recovery and added power-loss truncation tests.',
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
id: 'cx:led-done-2', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
639
|
+
name: 'Codex', role: '', ws: WORKSPACES.ledger, branch: 'chore/grpc-balance-proto', client: 'cli',
|
|
640
|
+
person: PEOPLE.ken, model: 'gpt-5.5-codex', mode: 'done', stepSec: 5, ageMin: 345, endedMin: 228,
|
|
641
|
+
tok: { in: 960, cache: 6800, out: 390 },
|
|
642
|
+
label: 'gRPC balance query protos',
|
|
643
|
+
task: 'Regenerate Go protobuf stubs for AccountBalanceSnapshot RPC',
|
|
644
|
+
files: [{ path: 'proto/ledger/v2/balance.proto', op: 'edited' }],
|
|
645
|
+
actions: [
|
|
646
|
+
{ tool: 'shell', arg: 'buf generate proto/ledger/v2', res: 'Generated Go gRPC stubs with zero lint warnings.' },
|
|
647
|
+
{ tool: 'shell', arg: 'go test ./api/grpc/...', res: 'ok ledgerline/core-ledger/api/grpc 0.62s.' },
|
|
648
|
+
],
|
|
649
|
+
result: 'Updated AccountBalanceSnapshot proto and regenerated gRPC server stubs.',
|
|
650
|
+
},
|
|
651
|
+
|
|
652
|
+
// ================================================================ infra (Terraform / Kubernetes)
|
|
653
|
+
{
|
|
654
|
+
id: 'cc:inf-deploy', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
655
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.infra, branch: 'release/eu-west-eks-1.32', client: 'cli',
|
|
656
|
+
person: PEOPLE.aylin, model: 'claude-opus-5-5', mode: 'stall-b', stepSec: 4, ageMin: 54,
|
|
657
|
+
tok: { in: 1410, cache: 10900, out: 570 },
|
|
658
|
+
label: 'EKS 1.32 blue-green plan',
|
|
659
|
+
task: 'Prepare Terraform plan and Helm values for zero-downtime eu-west EKS 1.32 rollout',
|
|
660
|
+
files: [
|
|
661
|
+
{ path: 'terraform/eu-west/eks.tf', op: 'edited' },
|
|
662
|
+
{ path: 'helm/payments-api/values-prod.yaml', op: 'edited' },
|
|
663
|
+
],
|
|
664
|
+
stalledAction: 'Bash: terraform apply -target=module.settlement_eks (permission prompt)',
|
|
665
|
+
actions: [
|
|
666
|
+
{ tool: 'Edit', arg: 'terraform/eu-west/eks.tf', res: 'Bumped cluster_version to 1.32 with blue-green nodegroup.' },
|
|
667
|
+
{ tool: 'Bash', arg: 'terraform plan -out=eu-west.tfplan terraform/eu-west', res: 'Plan: 4 to add, 2 to change, 0 to destroy.' },
|
|
668
|
+
{ tool: 'Edit', arg: 'helm/payments-api/values-prod.yaml', res: 'Set PodDisruptionBudget minAvailable: 80%.' },
|
|
669
|
+
{ tool: 'Bash', arg: 'helm template payments-api helm/payments-api | kubeconform -strict', res: 'All 19 Kubernetes manifests valid for 1.32.' },
|
|
670
|
+
],
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
id: 'cx:inf-netpol', provider: 'codex', tool: 'Codex', kind: 'session', parent: null,
|
|
674
|
+
name: 'Codex', role: '', ws: WORKSPACES.infra, branch: 'sec/pci-network-policy', client: 'cli',
|
|
675
|
+
person: PEOPLE.aylin, model: 'gpt-5.5-codex', mode: 'working', stepSec: 4, ageMin: 49,
|
|
676
|
+
tok: { in: 1040, cache: 7500, out: 430 },
|
|
677
|
+
label: 'PCI-DSS egress policies',
|
|
678
|
+
task: 'Tighten Cilium egress network policies around payments-api cardholder namespace',
|
|
679
|
+
files: [{ path: 'k8s/cilium/payments-egress.yaml', op: 'edited' }],
|
|
680
|
+
actions: [
|
|
681
|
+
{ tool: 'apply_patch', arg: 'k8s/cilium/payments-egress.yaml', res: 'Restricted FQDN egress to SWIFT and card network endpoints.' },
|
|
682
|
+
{ tool: 'shell', arg: 'kubectl diff -f k8s/cilium/payments-egress.yaml', res: '1 CiliumNetworkPolicy diff ready for staging.' },
|
|
683
|
+
{ tool: 'shell', arg: 'cilium connectivity test --test to-fqdns --dry-run', res: 'Policy graph validated: 0 unintended allow rules.' },
|
|
684
|
+
],
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
id: 'cc:inf-done-recent', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
688
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.infra, branch: 'chore/prometheus-alerts', client: 'cli',
|
|
689
|
+
person: PEOPLE.ken, model: 'claude-haiku-5-5', mode: 'done', stepSec: 5, ageMin: 84, endedMin: 32,
|
|
690
|
+
tok: { in: 720, cache: 5100, out: 290 },
|
|
691
|
+
label: 'Settlement lag alert rules',
|
|
692
|
+
task: 'Add Prometheus SLO burn-rate alerts for ACH settlement queue lag',
|
|
693
|
+
files: [{ path: 'monitoring/alerts/settlement-slo.yaml', op: 'created' }],
|
|
694
|
+
actions: [
|
|
695
|
+
{ tool: 'Write', arg: 'monitoring/alerts/settlement-slo.yaml', res: 'Added 5m/1h multi-window SLO burn-rate rules.' },
|
|
696
|
+
{ tool: 'Bash', arg: 'promtool test rules monitoring/alerts/settlement-slo-test.yaml', res: 'SUCCESS: 6 alert test cases passed.' },
|
|
697
|
+
],
|
|
698
|
+
result: 'Added ACH settlement SLO burn-rate alerts and verified with promtool.',
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
id: 'gc:inf-done-1', provider: 'gemini-cli', tool: 'Gemini CLI', kind: 'session', parent: null,
|
|
702
|
+
name: 'Gemini CLI', role: '', ws: WORKSPACES.infra, branch: 'chore/rds-param-audit', client: 'cli',
|
|
703
|
+
person: PEOPLE.aylin, model: 'gemini-4-flash', mode: 'done', stepSec: 5, ageMin: 268, endedMin: 174,
|
|
704
|
+
tok: { in: 840, cache: 5300, out: 340 },
|
|
705
|
+
label: 'RDS parameter group audit',
|
|
706
|
+
task: 'Compare production vs staging Postgres 17 parameter groups for drift',
|
|
707
|
+
files: [{ path: 'docs/runbooks/rds-pg17-diff.md', op: 'created' }],
|
|
708
|
+
actions: [
|
|
709
|
+
{ tool: 'write_file', arg: 'docs/runbooks/rds-pg17-diff.md', res: 'Documented 3 drifted work_mem and checkpoint settings.' },
|
|
710
|
+
],
|
|
711
|
+
result: 'Flagged 3 Postgres 17 parameter differences between staging and production.',
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
id: 'cc:inf-done-2', provider: 'claude-code', tool: 'Claude Code', kind: 'session', parent: null,
|
|
715
|
+
name: 'Claude Code', role: '', ws: WORKSPACES.infra, branch: 'fix/cert-manager-issuer', client: 'cli',
|
|
716
|
+
person: PEOPLE.aylin, model: 'claude-sonnet-5-5', mode: 'done', stepSec: 5, ageMin: 348, endedMin: 274,
|
|
717
|
+
tok: { in: 980, cache: 7100, out: 390 },
|
|
718
|
+
label: 'mTLS issuer rotation',
|
|
719
|
+
task: 'Automate internal mTLS root CA staging rotation in cert-manager',
|
|
720
|
+
files: [{ path: 'k8s/cert-manager/internal-ca.yaml', op: 'edited' }],
|
|
721
|
+
actions: [
|
|
722
|
+
{ tool: 'Edit', arg: 'k8s/cert-manager/internal-ca.yaml', res: 'Enabled 30-day rotationBefore and Vault PKI backend.' },
|
|
723
|
+
],
|
|
724
|
+
result: 'Configured automated 30-day mTLS CA rotation in cert-manager.',
|
|
725
|
+
},
|
|
726
|
+
];
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// Templates for the 6 preceding local calendar days so weekly charts and daily reports
|
|
730
|
+
// show busy weekdays across all projects/vendors and quiet weekend days.
|
|
731
|
+
const WEEKDAY_TEMPLATES = [
|
|
732
|
+
{
|
|
733
|
+
slug: 'sepa-instant', provider: 'claude-code', tool: 'Claude Code', ws: WORKSPACES.payments,
|
|
734
|
+
branch: 'feat/instant-sepa', person: PEOPLE.maya, model: 'claude-opus-5-5',
|
|
735
|
+
startH: 9, startM: 25, durMin: 95, tok: { in: 1900, cache: 16200, out: 820 },
|
|
736
|
+
label: 'SEPA Instant settlement rail',
|
|
737
|
+
task: 'Implement SEPA Instant 10-second timeout circuit breaker and fallback queue',
|
|
738
|
+
files: [{ path: 'src/settlement/sepa-instant.ts', op: 'created' }],
|
|
739
|
+
actions: [{ tool: 'Bash', arg: 'npm test -- sepa-instant', res: '52 passed, 0 failed.' }],
|
|
740
|
+
result: 'Delivered SEPA Instant circuit breaker with automatic fallback routing.',
|
|
741
|
+
sub: {
|
|
742
|
+
name: 'sepa-tests', role: 'integration tests', model: 'claude-sonnet-5-5',
|
|
743
|
+
durMin: 42, tok: { in: 880, cache: 6900, out: 360 },
|
|
744
|
+
task: 'Add SEPA Instant timeout and replay integration tests',
|
|
745
|
+
files: [{ path: 'tests/settlement/sepa-instant.test.ts', op: 'created' }],
|
|
746
|
+
actions: [{ tool: 'Bash', arg: 'npm test -- sepa-instant', res: '52 passed, 0 failed.' }],
|
|
747
|
+
result: 'Verified SEPA Instant fallback routing across 52 integration cases.',
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
slug: 'reconcile-cli', provider: 'codex', tool: 'Codex', ws: WORKSPACES.ledger,
|
|
752
|
+
branch: 'feat/reconciliation-cli', person: PEOPLE.ken, model: 'gpt-5.5-codex',
|
|
753
|
+
startH: 10, startM: 40, durMin: 82, tok: { in: 1650, cache: 13100, out: 710 },
|
|
754
|
+
label: 'Daily reconciliation CLI',
|
|
755
|
+
task: 'Build Go CLI to reconcile clearinghouse settlement files against core-ledger',
|
|
756
|
+
files: [{ path: 'cmd/reconcile/main.go', op: 'created' }],
|
|
757
|
+
actions: [{ tool: 'shell', arg: 'go test ./cmd/reconcile/...', res: 'ok ledgerline/core-ledger/cmd/reconcile 1.1s.' }],
|
|
758
|
+
result: 'Shipped daily clearinghouse reconciliation CLI with mismatch CSV export.',
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
slug: 'virtual-cards', provider: 'antigravity', tool: 'Antigravity', ws: WORKSPACES.mobile,
|
|
762
|
+
branch: 'feat/virtual-cards', person: PEOPLE.daniel, model: 'gemini-4-pro',
|
|
763
|
+
startH: 13, startM: 15, durMin: 88, tok: { in: 1740, cache: 14200, out: 740 },
|
|
764
|
+
label: 'Single-use virtual cards',
|
|
765
|
+
task: 'Add single-use virtual card issuance and Apple Wallet provisioning flow',
|
|
766
|
+
files: [{ path: 'src/screens/VirtualCard.tsx', op: 'created' }],
|
|
767
|
+
actions: [{ tool: 'run_command', arg: 'npm test -- VirtualCard', res: '31 passed, 0 failed.' }],
|
|
768
|
+
result: 'Completed single-use virtual card creation and Wallet pass provisioning.',
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
slug: 'pd-drift', provider: 'claude-code', tool: 'Claude Code', ws: WORKSPACES.risk,
|
|
772
|
+
branch: 'feat/psi-monitoring', person: PEOPLE.sofia, model: 'claude-sonnet-5-5',
|
|
773
|
+
startH: 15, startM: 5, durMin: 74, tok: { in: 1420, cache: 11400, out: 580 },
|
|
774
|
+
label: 'PSI drift alert job',
|
|
775
|
+
task: 'Compute weekly population stability index drift across SMB lending cohorts',
|
|
776
|
+
files: [{ path: 'pipelines/psi_weekly.py', op: 'created' }],
|
|
777
|
+
actions: [{ tool: 'Bash', arg: 'pytest tests/test_psi_weekly.py', res: '24 passed in 2.2s.' }],
|
|
778
|
+
result: 'Added automated PSI drift monitor with Slack threshold alerts.',
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
slug: 'kms-rotation', provider: 'gemini-cli', tool: 'Gemini CLI', ws: WORKSPACES.infra,
|
|
782
|
+
branch: 'sec/kms-key-policy', person: PEOPLE.aylin, model: 'gemini-4-flash',
|
|
783
|
+
startH: 16, startM: 20, durMin: 58, tok: { in: 1080, cache: 7800, out: 460 },
|
|
784
|
+
label: 'KMS envelope key rotation',
|
|
785
|
+
task: 'Audit Terraform KMS key policies and enable annual automatic key rotation',
|
|
786
|
+
files: [{ path: 'terraform/eu-west/kms.tf', op: 'edited' }],
|
|
787
|
+
actions: [{ tool: 'run_command', arg: 'terraform validate terraform/eu-west', res: 'Success! Configuration is valid.' }],
|
|
788
|
+
result: 'Enabled annual KMS key rotation and locked down decrypt principals.',
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
slug: 'wire-limits', provider: 'codex', tool: 'Codex', ws: WORKSPACES.payments,
|
|
792
|
+
branch: 'feat/swift-wire-caps', person: PEOPLE.aylin, model: 'gpt-5.5-codex',
|
|
793
|
+
startH: 11, startM: 10, durMin: 78, tok: { in: 1480, cache: 10900, out: 620 },
|
|
794
|
+
label: 'SWIFT wire corridor caps',
|
|
795
|
+
task: 'Enforce per-corridor daily wire transfer caps and compliance hold hooks',
|
|
796
|
+
files: [{ path: 'src/wires/corridor-caps.ts', op: 'created' }],
|
|
797
|
+
actions: [{ tool: 'shell', arg: 'npm test -- corridor-caps', res: '36 passed, 0 failed.' }],
|
|
798
|
+
result: 'Implemented corridor wire caps with automatic compliance queue escalation.',
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
slug: 'ledger-snap', provider: 'claude-code', tool: 'Claude Code', ws: WORKSPACES.ledger,
|
|
802
|
+
branch: 'perf/snapshot-compaction', person: PEOPLE.ken, model: 'claude-opus-5-5',
|
|
803
|
+
startH: 14, startM: 10, durMin: 86, tok: { in: 1720, cache: 13800, out: 690 },
|
|
804
|
+
label: 'WAL snapshot compaction',
|
|
805
|
+
task: 'Compact hourly account balance snapshots to cut cold-start replay by 70%',
|
|
806
|
+
files: [{ path: 'internal/wal/compact.go', op: 'edited' }],
|
|
807
|
+
actions: [{ tool: 'Bash', arg: 'go test -race ./internal/wal/...', res: 'ok ledgerline/core-ledger/internal/wal 2.4s.' }],
|
|
808
|
+
result: 'Cut ledger cold-start replay time by 73% with verified snapshot compaction.',
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
slug: 'fraud-features', provider: 'antigravity', tool: 'Antigravity', ws: WORKSPACES.risk,
|
|
812
|
+
branch: 'feat/device-graph', person: PEOPLE.sofia, model: 'gemini-4-neon-high',
|
|
813
|
+
startH: 10, startM: 5, durMin: 70, tok: { in: 1360, cache: 9900, out: 570 },
|
|
814
|
+
label: 'Device fingerprint graph',
|
|
815
|
+
task: 'Extract shared-device velocity features for account-takeover scoring model',
|
|
816
|
+
files: [{ path: 'features/device_graph.py', op: 'created' }],
|
|
817
|
+
actions: [{ tool: 'run_command', arg: 'pytest tests/test_device_graph.py', res: '19 passed in 1.5s.' }],
|
|
818
|
+
result: 'Added shared-device velocity features with zero PII stored in feature store.',
|
|
819
|
+
},
|
|
820
|
+
];
|
|
821
|
+
|
|
822
|
+
const WEEKEND_TEMPLATES = [
|
|
823
|
+
{
|
|
824
|
+
slug: 'oncall-runbook', provider: 'claude-code', tool: 'Claude Code', ws: WORKSPACES.infra,
|
|
825
|
+
branch: 'docs/weekend-oncall', person: PEOPLE.aylin, model: 'claude-haiku-5-5',
|
|
826
|
+
startH: 11, startM: 20, durMin: 28, tok: { in: 540, cache: 3800, out: 220 },
|
|
827
|
+
label: 'On-call runbook check',
|
|
828
|
+
task: 'Verify weekend pager escalation runbooks and staging alert silence windows',
|
|
829
|
+
files: [{ path: 'docs/runbooks/oncall-escalation.md', op: 'edited' }],
|
|
830
|
+
actions: [{ tool: 'Edit', arg: 'docs/runbooks/oncall-escalation.md', res: 'Updated EU holiday escalation schedule.' }],
|
|
831
|
+
result: 'Updated weekend on-call runbook and verified PagerDuty routing table.',
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
slug: 'mobile-lint', provider: 'gemini-cli', tool: 'Gemini CLI', ws: WORKSPACES.mobile,
|
|
835
|
+
branch: 'chore/deps-audit', person: PEOPLE.daniel, model: 'gemini-4-flash',
|
|
836
|
+
startH: 15, startM: 10, durMin: 24, tok: { in: 480, cache: 3200, out: 190 },
|
|
837
|
+
label: 'Dependency advisory check',
|
|
838
|
+
task: 'Review weekly npm audit report and pin patched transitive packages',
|
|
839
|
+
files: [{ path: 'package-lock.json', op: 'edited' }],
|
|
840
|
+
actions: [{ tool: 'run_command', arg: 'npm audit --omit=dev', res: 'found 0 vulnerabilities.' }],
|
|
841
|
+
result: 'Cleared 2 low-severity transitive advisories with zero breaking changes.',
|
|
842
|
+
},
|
|
843
|
+
];
|
|
844
|
+
|
|
845
|
+
const PREFIX_BY_PROV = { 'claude-code': 'cc:', antigravity: 'ag:', codex: 'cx:', 'gemini-cli': 'gc:' };
|
|
846
|
+
|
|
847
|
+
class DemoProvider {
|
|
848
|
+
constructor(cfg) {
|
|
849
|
+
this.cfg = cfg || {};
|
|
850
|
+
this.id = 'demo';
|
|
851
|
+
this.label = 'Demo (Ledgerline Bank)';
|
|
852
|
+
this.origin = typeof this.cfg.origin === 'number' ? this.cfg.origin : null;
|
|
853
|
+
this.lastNow = null;
|
|
854
|
+
this.byId = new Map();
|
|
855
|
+
this.blueprints = staticBlueprints();
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
available() { return true; }
|
|
859
|
+
|
|
860
|
+
handles(id) {
|
|
861
|
+
if (typeof id !== 'string') return false;
|
|
862
|
+
return DEMO_PREFIXES.some((p) => id.startsWith(p));
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
ensureOrigin(now) {
|
|
866
|
+
if (this.origin == null) this.origin = Math.floor(now / HOUR) * HOUR;
|
|
867
|
+
return this.origin;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
providersInfo(sessions) {
|
|
871
|
+
const counts = {};
|
|
872
|
+
for (const s of sessions) counts[s.provider] = (counts[s.provider] || 0) + 1;
|
|
873
|
+
return TOOL_META.map((t) => ({
|
|
874
|
+
id: t.id,
|
|
875
|
+
label: t.label,
|
|
876
|
+
available: true,
|
|
877
|
+
sessions: counts[t.id] || 0,
|
|
878
|
+
error: null,
|
|
879
|
+
}));
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
buildRotatingWaveSpecs(now, origin) {
|
|
883
|
+
const out = [];
|
|
884
|
+
const elapsed = Math.max(0, now - origin);
|
|
885
|
+
|
|
886
|
+
// payments-api rotating subagent (every 75 s one finishes and a new one starts)
|
|
887
|
+
const PAY_PERIOD = 75 * SEC;
|
|
888
|
+
const payPhase = Math.floor(elapsed / PAY_PERIOD);
|
|
889
|
+
const makePayWave = (phase, isActive) => {
|
|
890
|
+
const tpl = PAY_WAVES[((phase % PAY_WAVES.length) + PAY_WAVES.length) % PAY_WAVES.length];
|
|
891
|
+
const wStart = origin + phase * PAY_PERIOD;
|
|
892
|
+
const wEnd = wStart + PAY_PERIOD;
|
|
893
|
+
return {
|
|
894
|
+
id: 'cc:pay-lead/agent-wave-' + phase,
|
|
895
|
+
provider: 'claude-code', tool: 'Claude Code', kind: 'subagent', parent: 'cc:pay-lead',
|
|
896
|
+
name: tpl.name, role: tpl.role, ws: WORKSPACES.payments, branch: 'feat/ach-batch-retry', client: 'cli',
|
|
897
|
+
person: PEOPLE.maya, model: tpl.model, mode: isActive ? 'wave-active' : 'wave-done',
|
|
898
|
+
stepSec: 4, startedAt: wStart, endedAt: isActive ? null : wEnd,
|
|
899
|
+
tok: { in: 680, cache: 4900, out: 280 },
|
|
900
|
+
label: tpl.name, task: tpl.task, files: tpl.files, actions: tpl.actions, result: tpl.result,
|
|
901
|
+
};
|
|
902
|
+
};
|
|
903
|
+
out.push(makePayWave(payPhase, true));
|
|
904
|
+
out.push(makePayWave(payPhase - 1, false));
|
|
905
|
+
|
|
906
|
+
// mobile-app rotating subagent (every 85 s, staggered by 35 s)
|
|
907
|
+
const MOB_PERIOD = 85 * SEC;
|
|
908
|
+
const mobShifted = elapsed + 35 * SEC;
|
|
909
|
+
const mobPhase = Math.floor(mobShifted / MOB_PERIOD);
|
|
910
|
+
const makeMobWave = (phase, isActive) => {
|
|
911
|
+
const tpl = MOB_WAVES[((phase % MOB_WAVES.length) + MOB_WAVES.length) % MOB_WAVES.length];
|
|
912
|
+
const wStart = origin + phase * MOB_PERIOD - 35 * SEC;
|
|
913
|
+
const wEnd = wStart + MOB_PERIOD;
|
|
914
|
+
return {
|
|
915
|
+
id: 'ag:mob-wave-' + phase,
|
|
916
|
+
provider: 'antigravity', tool: 'Antigravity', kind: 'subagent', parent: 'ag:mob-lead',
|
|
917
|
+
name: tpl.name, role: tpl.role, ws: WORKSPACES.mobile, branch: 'feat/biometric-transfer', client: 'cli',
|
|
918
|
+
person: PEOPLE.daniel, model: tpl.model, mode: isActive ? 'wave-active' : 'wave-done',
|
|
919
|
+
stepSec: 4, startedAt: wStart, endedAt: isActive ? null : wEnd,
|
|
920
|
+
tok: { in: 720, cache: 5100, out: 310 },
|
|
921
|
+
label: tpl.name, task: tpl.task, files: tpl.files, actions: tpl.actions, result: tpl.result,
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
out.push(makeMobWave(mobPhase, true));
|
|
925
|
+
out.push(makeMobWave(mobPhase - 1, false));
|
|
926
|
+
|
|
927
|
+
return out;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
materialize(spec, now, origin) {
|
|
931
|
+
const elapsed = Math.max(0, now - origin);
|
|
932
|
+
const STALL_PERIOD = 110 * SEC;
|
|
933
|
+
const stallIdx = Math.floor(elapsed / STALL_PERIOD);
|
|
934
|
+
const stallPhase = stallIdx % 2;
|
|
935
|
+
const stallStart = origin + stallIdx * STALL_PERIOD;
|
|
936
|
+
|
|
937
|
+
const stepMs = (spec.stepSec || 4) * SEC;
|
|
938
|
+
const seed = hashId(spec.id);
|
|
939
|
+
const started = spec.startedAt != null ? spec.startedAt : origin - (spec.ageMin || 30) * MIN;
|
|
940
|
+
|
|
941
|
+
let effMode = spec.mode;
|
|
942
|
+
if (spec.mode === 'stall-a') effMode = stallPhase === 0 ? 'stalled' : 'working';
|
|
943
|
+
else if (spec.mode === 'stall-b') effMode = stallPhase === 1 ? 'stalled' : 'working';
|
|
944
|
+
|
|
945
|
+
let last, end, lastAction;
|
|
946
|
+
const actions = spec.actions || [];
|
|
947
|
+
const pickAction = (idx) => {
|
|
948
|
+
if (!actions.length) return '';
|
|
949
|
+
const a = actions[((idx % actions.length) + actions.length) % actions.length];
|
|
950
|
+
return a.tool + (a.arg ? ': ' + a.arg : '');
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
if (effMode === 'working' || effMode === 'wave-active') {
|
|
954
|
+
const n = Math.max(0, Math.floor((now - started) / stepMs));
|
|
955
|
+
last = Math.min(now, started + n * stepMs);
|
|
956
|
+
end = 'tool';
|
|
957
|
+
lastAction = pickAction(n);
|
|
958
|
+
} else if (effMode === 'waiting-parent') {
|
|
959
|
+
// Root orchestrator in core-ledger: turn ended recently while its 3-level subagent tree works,
|
|
960
|
+
// so Collector's liftParents() elevates it to "working (waiting on N subagents)".
|
|
961
|
+
const cycle = Math.floor(elapsed / (4 * MIN));
|
|
962
|
+
last = origin + cycle * (4 * MIN) - 2 * MIN;
|
|
963
|
+
end = 'turn';
|
|
964
|
+
lastAction = spec.subCalls && spec.subCalls.length ? spec.subCalls[0].tool + ': ' + spec.subCalls[0].arg : pickAction(0);
|
|
965
|
+
} else if (effMode === 'idle') {
|
|
966
|
+
const cycle = Math.floor(elapsed / (4 * MIN));
|
|
967
|
+
last = origin + cycle * (4 * MIN) - 3 * MIN;
|
|
968
|
+
end = 'turn';
|
|
969
|
+
lastAction = pickAction(actions.length - 1);
|
|
970
|
+
} else if (effMode === 'stalled') {
|
|
971
|
+
last = stallStart - 14 * MIN;
|
|
972
|
+
end = '';
|
|
973
|
+
lastAction = spec.stalledAction || pickAction(actions.length - 1);
|
|
974
|
+
} else if (effMode === 'failed') {
|
|
975
|
+
last = origin - (spec.endedMin || 16) * MIN;
|
|
976
|
+
end = 'error';
|
|
977
|
+
lastAction = spec.failAction || pickAction(actions.length - 1);
|
|
978
|
+
} else {
|
|
979
|
+
// 'done' or 'wave-done'
|
|
980
|
+
last = spec.endedAt != null ? spec.endedAt : origin - (spec.endedMin || 90) * MIN;
|
|
981
|
+
end = spec.kind === 'subagent' ? 'final' : 'turn';
|
|
982
|
+
lastAction = pickAction(actions.length - 1);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
if (last < started) last = started;
|
|
986
|
+
|
|
987
|
+
const tl = buildTimeline(seed, spec.model, started, last, origin, stepMs, spec.tok, now);
|
|
988
|
+
const models = {};
|
|
989
|
+
models[spec.model] = { in: tl.totals.in, cache: tl.totals.cache, out: tl.totals.out };
|
|
990
|
+
|
|
991
|
+
const session = {
|
|
992
|
+
id: spec.id,
|
|
993
|
+
provider: spec.provider,
|
|
994
|
+
tool: spec.tool,
|
|
995
|
+
kind: spec.kind,
|
|
996
|
+
parent: spec.parent || null,
|
|
997
|
+
name: spec.name,
|
|
998
|
+
role: spec.role || '',
|
|
999
|
+
label: spec.label || spec.name,
|
|
1000
|
+
task: spec.task,
|
|
1001
|
+
cwd: spec.ws.path,
|
|
1002
|
+
ws: { ...spec.ws, branch: spec.branch || spec.ws.branch },
|
|
1003
|
+
branch: spec.branch || '',
|
|
1004
|
+
client: spec.client || 'cli',
|
|
1005
|
+
user: spec.person ? spec.person.user : '',
|
|
1006
|
+
account: spec.person ? spec.person.account : '',
|
|
1007
|
+
started,
|
|
1008
|
+
last,
|
|
1009
|
+
steps: Math.max(1, tl.steps),
|
|
1010
|
+
model: spec.model,
|
|
1011
|
+
models,
|
|
1012
|
+
tokens: tl.totals,
|
|
1013
|
+
end,
|
|
1014
|
+
interactive: spec.kind === 'session',
|
|
1015
|
+
last_action: lastAction,
|
|
1016
|
+
partial: false,
|
|
1017
|
+
n_files: (spec.files || []).length,
|
|
1018
|
+
samples: tl.samples,
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
return { session, spec, effMode, started, last, stepMs, seed };
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
buildWeekHistorySpecs(origin) {
|
|
1025
|
+
const out = [];
|
|
1026
|
+
const base = new Date(origin);
|
|
1027
|
+
const y = base.getFullYear(), m = base.getMonth(), date = base.getDate();
|
|
1028
|
+
for (let d = 1; d <= 6; d++) {
|
|
1029
|
+
const dayDate = new Date(y, m, date - d);
|
|
1030
|
+
const dow = dayDate.getDay();
|
|
1031
|
+
const isWeekend = dow === 0 || dow === 6;
|
|
1032
|
+
const count = isWeekend ? 1 : 4;
|
|
1033
|
+
const pool = isWeekend ? WEEKEND_TEMPLATES : WEEKDAY_TEMPLATES;
|
|
1034
|
+
const scale = isWeekend ? 0.65 : (0.82 + ((d * 17) % 5) * 0.11);
|
|
1035
|
+
for (let k = 0; k < count; k++) {
|
|
1036
|
+
const tpl = pool[(d * 3 + k) % pool.length];
|
|
1037
|
+
const prefix = PREFIX_BY_PROV[tpl.provider] || 'cc:';
|
|
1038
|
+
const id = prefix + 'week-d' + d + '-' + k + '-' + tpl.slug;
|
|
1039
|
+
const startedAt = new Date(y, m, date - d, tpl.startH, tpl.startM, 0).getTime();
|
|
1040
|
+
const durMs = Math.round(tpl.durMin * scale) * MIN;
|
|
1041
|
+
const endedAt = Math.min(origin - 2 * HOUR, startedAt + durMs);
|
|
1042
|
+
if (endedAt <= startedAt) continue;
|
|
1043
|
+
// past days stand for a whole team's day, so they sit in the same range as today in the weekly charts
|
|
1044
|
+
const boost = scale * (isWeekend ? 1.6 : 3.8);
|
|
1045
|
+
const tok = {
|
|
1046
|
+
in: Math.round(tpl.tok.in * boost),
|
|
1047
|
+
cache: Math.round(tpl.tok.cache * boost),
|
|
1048
|
+
out: Math.round(tpl.tok.out * boost),
|
|
1049
|
+
};
|
|
1050
|
+
out.push({
|
|
1051
|
+
id,
|
|
1052
|
+
provider: tpl.provider,
|
|
1053
|
+
tool: tpl.tool,
|
|
1054
|
+
kind: 'session',
|
|
1055
|
+
parent: null,
|
|
1056
|
+
name: tpl.tool,
|
|
1057
|
+
role: '',
|
|
1058
|
+
ws: tpl.ws,
|
|
1059
|
+
branch: tpl.branch,
|
|
1060
|
+
client: 'cli',
|
|
1061
|
+
person: tpl.person,
|
|
1062
|
+
model: tpl.model,
|
|
1063
|
+
mode: 'done',
|
|
1064
|
+
stepSec: 5,
|
|
1065
|
+
startedAt,
|
|
1066
|
+
endedAt,
|
|
1067
|
+
tok,
|
|
1068
|
+
label: tpl.label,
|
|
1069
|
+
task: tpl.task,
|
|
1070
|
+
files: tpl.files,
|
|
1071
|
+
actions: tpl.actions,
|
|
1072
|
+
result: tpl.result,
|
|
1073
|
+
});
|
|
1074
|
+
if (tpl.sub && !isWeekend) {
|
|
1075
|
+
const subStart = startedAt + 12 * MIN;
|
|
1076
|
+
const subEnd = Math.min(endedAt, subStart + tpl.sub.durMin * MIN);
|
|
1077
|
+
if (subEnd > subStart) {
|
|
1078
|
+
out.push({
|
|
1079
|
+
id: id + '/sub-' + tpl.sub.name,
|
|
1080
|
+
provider: tpl.provider,
|
|
1081
|
+
tool: tpl.tool,
|
|
1082
|
+
kind: 'subagent',
|
|
1083
|
+
parent: id,
|
|
1084
|
+
name: tpl.sub.name,
|
|
1085
|
+
role: tpl.sub.role,
|
|
1086
|
+
ws: tpl.ws,
|
|
1087
|
+
branch: tpl.branch,
|
|
1088
|
+
client: 'cli',
|
|
1089
|
+
person: tpl.person,
|
|
1090
|
+
model: tpl.sub.model,
|
|
1091
|
+
mode: 'done',
|
|
1092
|
+
stepSec: 5,
|
|
1093
|
+
startedAt: subStart,
|
|
1094
|
+
endedAt: subEnd,
|
|
1095
|
+
tok: tpl.sub.tok,
|
|
1096
|
+
label: tpl.sub.name,
|
|
1097
|
+
task: tpl.sub.task,
|
|
1098
|
+
files: tpl.sub.files,
|
|
1099
|
+
actions: tpl.sub.actions,
|
|
1100
|
+
result: tpl.sub.result,
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return out;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
scan(now, windowMs) {
|
|
1110
|
+
const origin = this.ensureOrigin(now);
|
|
1111
|
+
this.lastNow = now;
|
|
1112
|
+
const from = now - (windowMs || 8 * DAY);
|
|
1113
|
+
const allSpecs = [...this.blueprints, ...this.buildWeekHistorySpecs(origin), ...this.buildRotatingWaveSpecs(now, origin)];
|
|
1114
|
+
const out = [];
|
|
1115
|
+
this.byId = new Map();
|
|
1116
|
+
for (const spec of allSpecs) {
|
|
1117
|
+
const built = this.materialize(spec, now, origin);
|
|
1118
|
+
if (built.last < from) continue;
|
|
1119
|
+
built.session.samples.prune(now - 8 * DAY);
|
|
1120
|
+
this.byId.set(spec.id, built);
|
|
1121
|
+
out.push(built.session);
|
|
1122
|
+
}
|
|
1123
|
+
return out;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
quotas(now) {
|
|
1127
|
+
const origin = this.ensureOrigin(now);
|
|
1128
|
+
const elapsedH = Math.max(0, now - origin) / HOUR;
|
|
1129
|
+
|
|
1130
|
+
const drain = (base, perHour, resetAt, windowMs) => {
|
|
1131
|
+
const winStart = resetAt - windowMs;
|
|
1132
|
+
const inWinH = Math.max(0, now - Math.max(origin, winStart)) / HOUR;
|
|
1133
|
+
const raw = base - inWinH * perHour;
|
|
1134
|
+
return Math.max(2, Math.min(98, Math.round(raw * 100) / 100));
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
const cc5h = nextReset(origin + 1 * HOUR + 20 * MIN, 5 * HOUR, now);
|
|
1138
|
+
const ccWk = nextReset(origin + 3 * DAY + 7 * HOUR + 15 * MIN, 7 * DAY, now);
|
|
1139
|
+
const cx5h = nextReset(origin + 2 * HOUR + 18 * MIN, 5 * HOUR, now);
|
|
1140
|
+
const cxWk = nextReset(origin + 4 * DAY + 11 * HOUR + 30 * MIN, 7 * DAY, now);
|
|
1141
|
+
const ag5h = nextReset(origin + 4 * HOUR + 5 * MIN, 5 * HOUR, now);
|
|
1142
|
+
const agWk = nextReset(origin + 5 * DAY + 2 * HOUR + 45 * MIN, 7 * DAY, now);
|
|
1143
|
+
|
|
1144
|
+
// Slight week drain over elapsedH so both windows tick down slowly and deterministically.
|
|
1145
|
+
const wkDrain = (base, perHour) => Math.max(8, Math.min(98, Math.round((base - elapsedH * perHour) * 100) / 100));
|
|
1146
|
+
|
|
1147
|
+
return [
|
|
1148
|
+
{
|
|
1149
|
+
id: 'claude-code',
|
|
1150
|
+
tool: 'Claude Code',
|
|
1151
|
+
label: 'Claude subscription',
|
|
1152
|
+
vendors: ['anthropic'],
|
|
1153
|
+
windows: [
|
|
1154
|
+
{ window: '5h', label: null, left_pct: drain(7.8, 3.6, cc5h, 5 * HOUR), resets_at: cc5h },
|
|
1155
|
+
{ window: 'week', label: null, left_pct: wkDrain(71, 1.8), resets_at: ccWk },
|
|
1156
|
+
],
|
|
1157
|
+
checked: now,
|
|
1158
|
+
error: null,
|
|
1159
|
+
optin: false,
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
id: 'codex',
|
|
1163
|
+
tool: 'Codex',
|
|
1164
|
+
label: 'ChatGPT plan (Codex)',
|
|
1165
|
+
vendors: ['openai'],
|
|
1166
|
+
windows: [
|
|
1167
|
+
{ window: '5h', label: null, left_pct: drain(78, 10.8, cx5h, 5 * HOUR), resets_at: cx5h, note: null },
|
|
1168
|
+
{ window: 'week', label: null, left_pct: wkDrain(82, 1.2), resets_at: cxWk, note: null },
|
|
1169
|
+
],
|
|
1170
|
+
checked: now,
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
id: 'antigravity:Gemini 4',
|
|
1174
|
+
tool: 'Antigravity',
|
|
1175
|
+
label: 'Gemini 4',
|
|
1176
|
+
shared: false,
|
|
1177
|
+
vendors: ['google'],
|
|
1178
|
+
checked: now,
|
|
1179
|
+
windows: [
|
|
1180
|
+
{ window: '5h', label: null, left_pct: drain(58, 12.6, ag5h, 5 * HOUR), resets_at: ag5h, note: null },
|
|
1181
|
+
{ window: 'week', label: null, left_pct: wkDrain(76, 1.5), resets_at: agWk, note: null },
|
|
1182
|
+
],
|
|
1183
|
+
},
|
|
1184
|
+
];
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
// Deterministic 7-day quota history for demo mode: 5h windows sawtooth on reset, weekly windows decay slowly.
|
|
1188
|
+
quotaHistory(now) {
|
|
1189
|
+
const cards = this.quotas(now);
|
|
1190
|
+
const step = 30 * MIN;
|
|
1191
|
+
const from = now - 7 * DAY;
|
|
1192
|
+
const firstTs = Math.ceil(from / step) * step;
|
|
1193
|
+
const out = [];
|
|
1194
|
+
|
|
1195
|
+
for (const q of cards) {
|
|
1196
|
+
const seenInCard = new Set();
|
|
1197
|
+
for (const w of q.windows || []) {
|
|
1198
|
+
if (w.left_pct == null) continue;
|
|
1199
|
+
const key = quotaWindowKey(q, w, seenInCard);
|
|
1200
|
+
seenInCard.add(key);
|
|
1201
|
+
const label = quotaWindowLabel(q, w);
|
|
1202
|
+
const seed = hashId(key);
|
|
1203
|
+
const points = [];
|
|
1204
|
+
const is5h = w.window === '5h';
|
|
1205
|
+
const winMs = is5h ? 5 * HOUR : 7 * DAY;
|
|
1206
|
+
const resetAt = w.resets_at || (now + winMs);
|
|
1207
|
+
const curStart = resetAt - winMs;
|
|
1208
|
+
const curSpan = Math.max(1, now - curStart);
|
|
1209
|
+
|
|
1210
|
+
for (let t = firstTs; t < now; t += step) {
|
|
1211
|
+
let pct;
|
|
1212
|
+
if (is5h) {
|
|
1213
|
+
if (t >= curStart) {
|
|
1214
|
+
const frac = Math.max(0, Math.min(1, (t - curStart) / curSpan));
|
|
1215
|
+
pct = 100 - (100 - w.left_pct) * frac;
|
|
1216
|
+
} else {
|
|
1217
|
+
const cycleIdx = Math.floor((t - curStart) / winMs);
|
|
1218
|
+
const pos = ((t - curStart) % winMs + winMs) % winMs;
|
|
1219
|
+
const frac = pos / winMs;
|
|
1220
|
+
const mid = new Date(curStart + (cycleIdx + 0.5) * winMs);
|
|
1221
|
+
const dow = mid.getDay(), hr = mid.getHours();
|
|
1222
|
+
const wf = (waveFactor(seed, cycleIdx) - 0.78) / 0.46; // [0, 1]
|
|
1223
|
+
const drainAmt = (dow === 0 || dow === 6)
|
|
1224
|
+
? (16 + wf * 22)
|
|
1225
|
+
: (hr < 8 || hr >= 21 ? (12 + wf * 18) : (48 + wf * 42));
|
|
1226
|
+
pct = 100 - drainAmt * frac;
|
|
1227
|
+
}
|
|
1228
|
+
} else {
|
|
1229
|
+
if (t >= curStart) {
|
|
1230
|
+
const frac = Math.max(0, Math.min(1, (t - curStart) / curSpan));
|
|
1231
|
+
const ripple = Math.sin(frac * Math.PI * 6) * 1.4;
|
|
1232
|
+
pct = 100 - (100 - w.left_pct) * frac + ripple * (1 - frac);
|
|
1233
|
+
} else {
|
|
1234
|
+
const prevStart = curStart - winMs;
|
|
1235
|
+
const frac = Math.max(0, Math.min(1, (t - prevStart) / winMs));
|
|
1236
|
+
const prevFloor = 18 + (seed % 16);
|
|
1237
|
+
pct = 100 - (100 - prevFloor) * frac;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
points.push([t, Math.max(2, Math.min(100, Math.round(pct * 10) / 10))]);
|
|
1241
|
+
}
|
|
1242
|
+
points.push([now, w.left_pct]);
|
|
1243
|
+
out.push({ key, label, points });
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
return out;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
buildRows(built) {
|
|
1250
|
+
const { spec, effMode, started, last, stepMs, seed } = built;
|
|
1251
|
+
const rows = [{ ts: started, kind: 'in', tool: 'prompt', text: spec.task }];
|
|
1252
|
+
const actions = spec.actions || [];
|
|
1253
|
+
const subs = spec.subCalls || [];
|
|
1254
|
+
|
|
1255
|
+
// Include subagent delegation rows near the beginning of a lead session's trace.
|
|
1256
|
+
subs.forEach((sc, idx) => {
|
|
1257
|
+
const ts = Math.min(last, started + (idx + 1) * 2000);
|
|
1258
|
+
rows.push({
|
|
1259
|
+
ts,
|
|
1260
|
+
kind: 'sub',
|
|
1261
|
+
tool: sc.tool,
|
|
1262
|
+
arg: sc.arg,
|
|
1263
|
+
child: sc.child,
|
|
1264
|
+
model: spec.model,
|
|
1265
|
+
tin: spec.tok.in,
|
|
1266
|
+
tc: spec.tok.cache,
|
|
1267
|
+
tout: Math.round(spec.tok.out * 0.6),
|
|
1268
|
+
dur: 650,
|
|
1269
|
+
res: 'Subagent started.',
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
const totalSteps = Math.max(1, Math.floor((last - started) / stepMs) + 1);
|
|
1274
|
+
const shownCount = Math.min(totalSteps, 45);
|
|
1275
|
+
const startIdx = totalSteps - shownCount;
|
|
1276
|
+
for (let i = startIdx; i < totalSteps; i++) {
|
|
1277
|
+
const a = actions.length ? actions[i % actions.length] : { tool: 'Read', arg: spec.ws.path, res: 'OK' };
|
|
1278
|
+
const ts = Math.min(last, started + i * stepMs);
|
|
1279
|
+
const f = waveFactor(seed, i);
|
|
1280
|
+
const isLast = i === totalSteps - 1;
|
|
1281
|
+
const row = {
|
|
1282
|
+
ts,
|
|
1283
|
+
kind: 'tool',
|
|
1284
|
+
tool: a.tool,
|
|
1285
|
+
arg: a.arg,
|
|
1286
|
+
model: spec.model,
|
|
1287
|
+
tin: Math.round(spec.tok.in * f),
|
|
1288
|
+
tc: Math.round(spec.tok.cache * f),
|
|
1289
|
+
tout: Math.round(spec.tok.out * f),
|
|
1290
|
+
dur: Math.round(320 + (f - 0.78) * 2400),
|
|
1291
|
+
res: a.res,
|
|
1292
|
+
};
|
|
1293
|
+
if (isLast && (effMode === 'working' || effMode === 'wave-active')) {
|
|
1294
|
+
row.running = 1;
|
|
1295
|
+
}
|
|
1296
|
+
rows.push(row);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
if (effMode === 'stalled') {
|
|
1300
|
+
rows.push({
|
|
1301
|
+
ts: last,
|
|
1302
|
+
kind: 'tool',
|
|
1303
|
+
tool: 'Bash',
|
|
1304
|
+
arg: (spec.stalledAction || '').replace(/^Bash:\s*/, ''),
|
|
1305
|
+
model: spec.model,
|
|
1306
|
+
running: 1,
|
|
1307
|
+
res: 'Waiting for permission approval from operator.',
|
|
1308
|
+
});
|
|
1309
|
+
} else if (effMode === 'failed') {
|
|
1310
|
+
rows.push({
|
|
1311
|
+
ts: last,
|
|
1312
|
+
kind: 'tool',
|
|
1313
|
+
tool: 'shell',
|
|
1314
|
+
arg: 'npm run build',
|
|
1315
|
+
model: spec.model,
|
|
1316
|
+
dur: 4120,
|
|
1317
|
+
err: 1,
|
|
1318
|
+
res: spec.failText || 'Build exited with status 1.',
|
|
1319
|
+
});
|
|
1320
|
+
} else if (effMode === 'idle') {
|
|
1321
|
+
rows.push({
|
|
1322
|
+
ts: last,
|
|
1323
|
+
kind: 'answer',
|
|
1324
|
+
tool: 'text',
|
|
1325
|
+
model: spec.model,
|
|
1326
|
+
text: spec.idleAnswer || 'Ready for your review and next instruction.',
|
|
1327
|
+
});
|
|
1328
|
+
} else if (effMode === 'done' || effMode === 'wave-done') {
|
|
1329
|
+
rows.push({
|
|
1330
|
+
ts: last,
|
|
1331
|
+
kind: 'answer',
|
|
1332
|
+
tool: 'text',
|
|
1333
|
+
model: spec.model,
|
|
1334
|
+
text: spec.result || 'Task completed.',
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
return { rows, total: rows.length + startIdx };
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
trace(id, limit, nowOpt) {
|
|
1342
|
+
const now = typeof nowOpt === 'number' ? nowOpt : (this.lastNow || Date.now());
|
|
1343
|
+
if (!this.byId.size || nowOpt !== undefined) this.scan(now, 8 * DAY);
|
|
1344
|
+
const built = this.byId.get(id);
|
|
1345
|
+
if (!built) return null;
|
|
1346
|
+
const { rows, total } = this.buildRows(built);
|
|
1347
|
+
const outRows = limit === 'all' ? rows : rows.slice(-(Number(limit) || 30));
|
|
1348
|
+
const result = built.effMode === 'done' || built.effMode === 'wave-done'
|
|
1349
|
+
? cut(built.spec.result || 'Task completed.', 6000)
|
|
1350
|
+
: built.effMode === 'idle'
|
|
1351
|
+
? cut(built.spec.idleAnswer || '', 6000)
|
|
1352
|
+
: null;
|
|
1353
|
+
return {
|
|
1354
|
+
rows: outRows,
|
|
1355
|
+
total,
|
|
1356
|
+
partial: false,
|
|
1357
|
+
task_full: built.spec.task,
|
|
1358
|
+
result,
|
|
1359
|
+
files: (built.spec.files || []).map((f) => ({ path: f.path, op: f.op })),
|
|
1360
|
+
commands: [],
|
|
1361
|
+
messages: [],
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
expand(id, i) {
|
|
1366
|
+
const now = this.lastNow || Date.now();
|
|
1367
|
+
if (!this.byId.size) this.scan(now, 8 * DAY);
|
|
1368
|
+
const built = this.byId.get(id);
|
|
1369
|
+
if (!built) return null;
|
|
1370
|
+
const { rows } = this.buildRows(built);
|
|
1371
|
+
const idx = Number(i);
|
|
1372
|
+
if (!Number.isInteger(idx) || idx < 0 || idx >= rows.length) return null;
|
|
1373
|
+
const r = rows[idx];
|
|
1374
|
+
const text = [r.tool, r.arg, r.text, r.res].filter(Boolean).join('\n');
|
|
1375
|
+
return { i: idx, text: cut(text, 20480), len: text.length };
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
module.exports = DemoProvider;
|