agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
35 lines • 1.56 kB
JavaScript
/**
* Engagement — the kernel-owned axis, orthogonal to every map's own cursor.
*
* Pattern: plain data. Everything here is a POJO that survives
* `structuredClone`, because engagement state rides chart scope
* across iterations.
* Role: the vocabulary of the mount kernel. A MAP (a skill map today; a
* screen map next) owns its cursor and never surrenders it; the
* KERNEL owns whether that map's contributions ride the next call.
* Parking a map never moves its cursor — that is the whole design.
*/
/**
* Every member id of every map the kernel currently holds PARKED.
*
* The one thing the engine asks the kernel (9.59.0), and deliberately a pure
* function over plain data: `src/maps/**` still imports nothing from the
* engine — the engine imports this. The `read_skill` gate needs it to tell a
* cursor move from a RE-ENGAGEMENT: a pick of a parked map's member is a
* request for that map's contribution to ride again, which changes engagement
* and not position, so the "you are already there" refusal (correct for a
* move) is wrong for it.
*/
export function parkedMemberIds(plan, engagement) {
const out = new Set();
if (engagement === undefined)
return out;
const parked = new Set(engagement.filter((r) => r.standing === 'parked').map((r) => r.mapId));
for (const map of plan.maps) {
if (parked.has(map.id))
for (const id of map.memberIds)
out.add(id);
}
return out;
}
//# sourceMappingURL=types.js.map