Skip to content

Commit 2a6d3b3

Browse files
committed
fix: remove all intentTag references for agentforge 0.2.0
intentTag was removed from MessageEnvelope in agentforge 0.2.0. Cleaned up all agent classes, base class, and tests. Made-with: Cursor
1 parent 177f0d9 commit 2a6d3b3

9 files changed

+24
-52
lines changed

sim/agents/BadActorPersonaAgent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export class BadActorPersonaAgent extends BaseElataPersonaLlmAgent {
2525
name: 'RpcCall',
2626
params: { method: 'eth_blockNumber', params: [] },
2727
rationale: 'Probe chain state before choosing manipulation target.',
28-
metadata: { intentTag: 'bad_actor', confidence: 0.55 },
28+
metadata: { confidence: 0.55 },
2929
};
3030
}
3131

3232
const buyAmount = BigInt(75e18);
3333
if (!this.hasEnoughElta(buyAmount)) {
34-
return { name: 'noop', params: { reason: 'bad_actor_no_budget' }, metadata: { intentTag: 'bad_actor' } };
34+
return { name: 'noop', params: { reason: 'bad_actor_no_budget' } };
3535
}
3636
const buy = buyAppToken(String(target.id), target.tokenAddress, buyAmount);
3737
return {
@@ -43,7 +43,7 @@ export class BadActorPersonaAgent extends BaseElataPersonaLlmAgent {
4343
minTokensOut: buy.minTokensOut,
4444
},
4545
rationale: 'Push price quickly to create short-term dislocation.',
46-
metadata: { intentTag: 'bad_actor', confidence: 0.72 },
46+
metadata: { confidence: 0.72 },
4747
};
4848
}
4949
}

sim/agents/BaseElataPersonaLlmAgent.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type ParsedIntent = {
3030
name: string;
3131
params: Record<string, unknown>;
3232
rationale?: string;
33-
metadata?: { personaId?: string; intentTag?: string; confidence?: number };
33+
metadata?: { personaId?: string; confidence?: number };
3434
};
3535

3636
type ParsedIntentDiagnostics = {
@@ -243,7 +243,6 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
243243
),
244244
worldDelta: observationDelta.slice(0, 240),
245245
memorySummary: memorySummary.slice(0, 240),
246-
intentTag: intent.metadata?.intentTag ?? 'none',
247246
},
248247
});
249248
return action;
@@ -278,7 +277,7 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
278277
: 'Posting cadence can be opportunistic within scenario budgets.',
279278
stage === 'plan'
280279
? 'Return STRICT JSON only: {"hypothesis":"...","target":{"domain":"market|governance|fees|gossip|rpc|other","identifier":"..."},"expectedEffect":"...","preferredActionFamily":"QueryWorld|RpcCall|PostMessage|ContractCall|ContractRead|ProtocolAction","confidence":0.0}'
281-
: 'Return STRICT JSON only: {"name":"ActionName","params":{},"rationale":"...","metadata":{"personaId":"...","intentTag":"...","confidence":0.0}}. If postingPolicy.postTargetDue=true in user context, strongly prefer PostMessage with concise persona interpretation (not raw stat dump).',
280+
: 'Return STRICT JSON only: {"name":"ActionName","params":{},"rationale":"...","metadata":{"personaId":"...","confidence":0.0}}. If postingPolicy.postTargetDue=true in user context, strongly prefer PostMessage with concise persona interpretation (not raw stat dump).',
282281
].join(' ');
283282
}
284283

@@ -390,9 +389,6 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
390389
...(parsed.metadata.personaId !== undefined
391390
? { personaId: parsed.metadata.personaId }
392391
: {}),
393-
...(parsed.metadata.intentTag !== undefined
394-
? { intentTag: this.normalizeIntentTag(parsed.metadata.intentTag) }
395-
: {}),
396392
...(parsed.metadata.confidence !== undefined
397393
? { confidence: parsed.metadata.confidence }
398394
: {}),
@@ -509,7 +505,6 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
509505
private intentToAction(intent: ParsedIntent, ctx: TickContext, llmSource: string): Action | null {
510506
const personaMetadata = {
511507
personaId: intent.metadata?.personaId ?? this.getPersonaProfile().id,
512-
...(intent.metadata?.intentTag ? { intentTag: intent.metadata.intentTag } : {}),
513508
...(intent.rationale ? { rationale: intent.rationale } : {}),
514509
llmSource,
515510
};
@@ -547,17 +542,12 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
547542
if (text.length === 0) {
548543
return this.createAction('noop', { type: 'noop', reason: 'empty_gossip_message' }, ctx.tick);
549544
}
550-
const intentTagRaw =
551-
typeof intent.params.intentTag === 'string'
552-
? this.normalizeIntentTag(intent.params.intentTag)
553-
: 'other';
554545
const action: Action = {
555546
id: this.generateActionId('PostMessage', ctx.tick),
556547
name: 'PostMessage',
557548
params: {
558549
channelId,
559550
text,
560-
intentTag: intentTagRaw,
561551
},
562552
metadata: personaMetadata,
563553
};
@@ -643,12 +633,10 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
643633
params: {
644634
channelId,
645635
text,
646-
intentTag: this.normalizeIntentTag(personaId),
647636
},
648637
rationale: 'Share concise world update due to posting guardrail trigger.',
649638
metadata: {
650639
personaId,
651-
intentTag: this.normalizeIntentTag(personaId),
652640
confidence: 0.51,
653641
},
654642
};
@@ -817,12 +805,6 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
817805
return normalized.slice(start, end + 1);
818806
}
819807

820-
private normalizeIntentTag(raw: unknown): string {
821-
const tag = String(raw ?? '').trim().toLowerCase();
822-
if (!tag) return 'other';
823-
return tag;
824-
}
825-
826808
private salvageIntent(payload: unknown): ParsedIntent | null {
827809
if (!payload || typeof payload !== 'object') return null;
828810
const candidate = payload as Record<string, unknown>;
@@ -842,9 +824,6 @@ export abstract class BaseElataPersonaLlmAgent extends BaseProtocolAgent {
842824
...(typeof metadataRaw.personaId === 'string' && metadataRaw.personaId.trim().length > 0
843825
? { personaId: metadataRaw.personaId.trim() }
844826
: {}),
845-
...(metadataRaw.intentTag !== undefined
846-
? { intentTag: this.normalizeIntentTag(metadataRaw.intentTag) }
847-
: {}),
848827
...(typeof metadataRaw.confidence === 'number' &&
849828
Number.isFinite(metadataRaw.confidence) &&
850829
metadataRaw.confidence >= 0 &&

sim/agents/CreatorPersonaAgent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class CreatorPersonaAgent extends BaseElataPersonaLlmAgent {
2121
protected getFallbackIntent(ctx: TickContext) {
2222
const world = this.getWorldState();
2323
if (world.appCount >= 18 || ctx.tick % 2 !== 0) {
24-
return { name: 'noop', params: { reason: 'creator_wait' }, metadata: { intentTag: 'creator' } };
24+
return { name: 'noop', params: { reason: 'creator_wait' } };
2525
}
2626
const suffix = `${this.id}-${ctx.tick}`;
2727
const action = createApp(`PersonaApp-${suffix}`, `PA${ctx.tick % 100}`, `ipfs://persona/${suffix}`);
@@ -33,7 +33,7 @@ export class CreatorPersonaAgent extends BaseElataPersonaLlmAgent {
3333
metadataUri: action.metadataUri,
3434
},
3535
rationale: 'Expand protocol surface with a fresh app launch.',
36-
metadata: { intentTag: 'creator', confidence: 0.7 },
36+
metadata: { confidence: 0.7 },
3737
};
3838
}
3939
}

sim/agents/EconomicPersonaAgent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class EconomicPersonaAgent extends BaseElataPersonaLlmAgent {
2424
return {
2525
name: 'QueryWorld',
2626
params: { endpoint: this.getQueryEndpointHint(), params: {} },
27-
metadata: { intentTag: 'economic', confidence: 0.6 },
27+
metadata: { confidence: 0.6 },
2828
};
2929
}
3030

@@ -40,13 +40,13 @@ export class EconomicPersonaAgent extends BaseElataPersonaLlmAgent {
4040
minEltaOut: sell.minEltaOut,
4141
},
4242
rationale: 'Realize gains and rebalance exposure.',
43-
metadata: { intentTag: 'economic', confidence: 0.65 },
43+
metadata: { confidence: 0.65 },
4444
};
4545
}
4646

4747
const buyAmount = BigInt(40e18);
4848
if (!this.hasEnoughElta(buyAmount)) {
49-
return { name: 'noop', params: { reason: 'reserve_preservation' }, metadata: { intentTag: 'economic' } };
49+
return { name: 'noop', params: { reason: 'reserve_preservation' } };
5050
}
5151
const buy = buyAppToken(String(target.id), target.tokenAddress, buyAmount);
5252
return {
@@ -58,7 +58,7 @@ export class EconomicPersonaAgent extends BaseElataPersonaLlmAgent {
5858
minTokensOut: buy.minTokensOut,
5959
},
6060
rationale: 'Allocate ELTA into active app market.',
61-
metadata: { intentTag: 'economic', confidence: 0.7 },
61+
metadata: { confidence: 0.7 },
6262
};
6363
}
6464
}

sim/agents/HackerPersonaAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class HackerPersonaAgent extends BaseElataPersonaLlmAgent {
2424
name: 'RpcCall',
2525
params: { method, params },
2626
rationale: 'Continuously probe low-level chain state for anomalies.',
27-
metadata: { intentTag: 'hacker', confidence: 0.68 },
27+
metadata: { confidence: 0.68 },
2828
};
2929
}
3030
}

sim/agents/LlmGossipCoordinatorAgent.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ export class LlmGossipCoordinatorAgent extends BaseProtocolAgent {
135135
channelId,
136136
{ text },
137137
{
138-
intentTag: 'inform',
139138
audience: { type: 'public' },
140139
credibilityPrior: isLiveProvider ? 0.65 : 0.95,
141140
}

sim/agents/SaboteurPersonaAgent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export class SaboteurPersonaAgent extends BaseElataPersonaLlmAgent {
2525
name: 'RpcCall',
2626
params: { method: 'eth_gasPrice', params: [] },
2727
rationale: 'Sample network conditions before sabotage attempts.',
28-
metadata: { intentTag: 'saboteur', confidence: 0.5 },
28+
metadata: { confidence: 0.5 },
2929
};
3030
}
3131

3232
const held = this.getAppTokenBalance(String(target.id));
3333
if (held <= 0n) {
34-
return { name: 'noop', params: { reason: 'no_inventory_to_dump' }, metadata: { intentTag: 'saboteur' } };
34+
return { name: 'noop', params: { reason: 'no_inventory_to_dump' } };
3535
}
3636
const sell = sellAppToken(String(target.id), target.tokenAddress, held);
3737
return {
@@ -43,7 +43,7 @@ export class SaboteurPersonaAgent extends BaseElataPersonaLlmAgent {
4343
minEltaOut: sell.minEltaOut,
4444
},
4545
rationale: 'Dump holdings to trigger volatility.',
46-
metadata: { intentTag: 'saboteur', confidence: 0.8 },
46+
metadata: { confidence: 0.8 },
4747
};
4848
}
4949
}

sim/tests/memory/agent-memory-shapes.test.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,10 @@ test('key agents populate decision memory with expected reason codes', async ()
101101
tick: 1,
102102
authorAgentId: 'x',
103103
channelId: 'governance',
104-
audience: { type: 'public' },
105-
intentTag: 'inform',
106-
costPaid: 1,
107-
credibilityPrior: 0.8,
108-
payloadHash: 'abc',
104+
audience: { type: 'public' },
105+
costPaid: 1,
106+
credibilityPrior: 0.8,
107+
payloadHash: 'abc',
109108
},
110109
payload: { text: 'vote on proposal and claim reward' },
111110
},
@@ -224,7 +223,6 @@ test('gossip consumer agents record inbox-derived context fields', async () => {
224223
authorAgentId: 'llm-1',
225224
channelId: 'governance',
226225
audience: { type: 'public' },
227-
intentTag: 'coordinate',
228226
costPaid: 1,
229227
credibilityPrior: 0.9,
230228
payloadHash: 'hash',
@@ -253,7 +251,6 @@ test('gossip consumer agents record inbox-derived context fields', async () => {
253251
authorAgentId: 'llm-2',
254252
channelId: 'risk',
255253
audience: { type: 'public' },
256-
intentTag: 'inform',
257254
costPaid: 1,
258255
credibilityPrior: 0.7,
259256
payloadHash: 'hash-2',
@@ -283,7 +280,6 @@ test('gossip consumer agents record inbox-derived context fields', async () => {
283280
authorAgentId: 'llm-3',
284281
channelId: 'markets',
285282
audience: { type: 'public' },
286-
intentTag: 'inform',
287283
costPaid: 1,
288284
credibilityPrior: 0.6,
289285
payloadHash: 'hash-3',

sim/tests/memory/persona-agents.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ class GossipHarness extends BaseElataPersonaLlmAgent {
6565
params: {
6666
channelId: 'global',
6767
text: 'state changed',
68-
intentTag: 'inform',
6968
},
7069
rationale: 'share signal',
71-
metadata: { personaId: 'gossip-test', intentTag: 'inform', confidence: 0.6 },
70+
metadata: { personaId: 'gossip-test', confidence: 0.6 },
7271
};
7372
}
7473

@@ -91,7 +90,7 @@ class LlmGuardrailHarness extends BaseElataPersonaLlmAgent {
9190
return {
9291
name: 'noop',
9392
params: { reason: 'fallback_unused' },
94-
metadata: { personaId: 'guardrail-test', intentTag: 'observer' },
93+
metadata: { personaId: 'guardrail-test' },
9594
};
9695
}
9796

@@ -158,7 +157,6 @@ test('persona fallback can emit PostMessage with normalized intent metadata', as
158157
setAgentBalance(gossip, { elta: BigInt(100e18), veElta: 0n });
159158
const action = await gossip.step(createTestContext({ tick: 3 }));
160159
assert.equal(action?.name, 'PostMessage');
161-
assert.equal(String((action as Action)?.params?.intentTag ?? ''), 'inform');
162160
assert.match(getLastReason(gossip), /persona_gossip-test_/);
163161
});
164162

@@ -189,7 +187,7 @@ test('persona action parse salvage keeps valid action and logs diagnostics', asy
189187
if (calls === 1) {
190188
return '{"hypothesis":"observe","expectedEffect":"act","preferredActionFamily":"PostMessage","confidence":0.9}';
191189
}
192-
return '{"name":"PostMessage","params":{"channelId":"global","text":"salvaged signal"},"metadata":{"personaId":"guardrail-test","intentTag":"inform","confidence":2}}';
190+
return '{"name":"PostMessage","params":{"channelId":"global","text":"salvaged signal"},"metadata":{"personaId":"guardrail-test","confidence":2}}';
193191
},
194192
};
195193
const gossip = {
@@ -253,9 +251,9 @@ test('llm post retry prefers PostMessage when posting is due', async () => {
253251
return '{"hypothesis":"scan inbox","expectedEffect":"decide","preferredActionFamily":"QueryWorld","confidence":0.7}';
254252
}
255253
if (calls === 2) {
256-
return '{"name":"QueryWorld","params":{"endpoint":"get_world"},"metadata":{"personaId":"guardrail-test","intentTag":"observer","confidence":0.6}}';
254+
return '{"name":"QueryWorld","params":{"endpoint":"get_world"},"metadata":{"personaId":"guardrail-test","confidence":0.6}}';
257255
}
258-
return '{"name":"PostMessage","params":{"channelId":"global","text":"I disagree with prior signal; risk is underestimated","intentTag":"coordinate"},"metadata":{"personaId":"guardrail-test","intentTag":"coordinate","confidence":0.75}}';
256+
return '{"name":"PostMessage","params":{"channelId":"global","text":"I disagree with prior signal; risk is underestimated"},"metadata":{"personaId":"guardrail-test","confidence":0.75}}';
259257
},
260258
};
261259
const gossip = {

0 commit comments

Comments
 (0)