hey, i was exploring tests/cursor-provider.test.ts and noticed that the cursor provider handles invalid top-level payload shapes safely, e.g when payload is null, missing agents or has no valid agents array, that part looks good
but one edge case seems uncovered, when payload.agents exists as an array but individual agent objects inside it are malformed or partially invalid
e.g, this kind of payload would still pass the top-level “agents array exists” check
payload: {
agents: [
{
id: "agent-1",
name: "Agent One",
status: 123,
updatedAt: "not-a-number",
source: "cursor-transcripts",
},
],
}
since cursor().normalize() currently delegates directly to normalizeFromPayload(readResult), i was wondering whether malformed agent entries are validated there before becoming part of the canonical snapshot
main concern is that in current deployment, agentprobe is passively reading external transcript/log artifacts, those files can be incomplete, changing while being read or produced by slightly different cursor versions, if one malformed agent item enters the normalized snapshot, consumers may receive invalid lifecycle events, broken status transitions or runtime errors downstream
would it make sense to validate each agent entry during normalization and drop or warn on malformed records instead of trusting the whole agents array once it exists?
i would love to work on this issue if it is relevant
hey, i was exploring
tests/cursor-provider.test.tsand noticed that the cursor provider handles invalid top-level payload shapes safely, e.g whenpayloadisnull, missingagentsor has no valid agents array, that part looks goodbut one edge case seems uncovered, when
payload.agentsexists as an array but individual agent objects inside it are malformed or partially invalide.g, this kind of payload would still pass the top-level “agents array exists” check
since
cursor().normalize()currently delegates directly tonormalizeFromPayload(readResult), i was wondering whether malformed agent entries are validated there before becoming part of the canonical snapshotmain concern is that in current deployment, agentprobe is passively reading external transcript/log artifacts, those files can be incomplete, changing while being read or produced by slightly different cursor versions, if one malformed agent item enters the normalized snapshot, consumers may receive invalid lifecycle events, broken status transitions or runtime errors downstream
would it make sense to validate each agent entry during normalization and drop or warn on malformed records instead of trusting the whole agents array once it exists?
i would love to work on this issue if it is relevant