agnets done
This commit is contained in:
@@ -5212,6 +5212,53 @@ record('...and leaves the date-anchored shift records to the Go seeder',
|
||||
!('ShiftRecord' in JSON.parse(builtFixture).entities) && seedModule.seedData.ShiftRecord.length > 0,
|
||||
`${seedModule.seedData.ShiftRecord.length} shift records held in seed.js only`);
|
||||
|
||||
/* ── The registry does not report a shipped agent as an override of itself ── */
|
||||
|
||||
/**
|
||||
* Authored agents now come from `/api/v1/agent-definitions`, and that registry
|
||||
* holds both kinds: the shipped set, published from the same files this build
|
||||
* ships, and anything a person authored. Passing the first kind through as an
|
||||
* authored source made every shipped agent report that it "replaces the
|
||||
* built-in agent of the same id" — nine warnings on the one screen that exists
|
||||
* to say what is wrong, about a deployment that was working correctly.
|
||||
*
|
||||
* The rows below are the shape the live registry actually returns.
|
||||
*/
|
||||
const storeModule = await server.ssrLoadModule('/src/lib/agents/agentStore.js');
|
||||
const agentsModule = await server.ssrLoadModule('/src/lib/agents/registry.js');
|
||||
const shippedIds = new Set(agentsModule.AGENTS.map((a) => a.id));
|
||||
const registryRows = [
|
||||
...agentsModule.AGENTS.map((a) => ({
|
||||
definition_id: a.id, visibility: 'organization', markdown: a.markdown,
|
||||
})),
|
||||
{
|
||||
definition_id: 'authored-example', visibility: 'personal',
|
||||
markdown: '---\nid: authored-example\nname: Authored Example\nstatus: published\n'
|
||||
+ 'version: 1\npages:\n - control-center\n---\n\n# Authored Example\n',
|
||||
},
|
||||
];
|
||||
const built = agentsModule.readAgentRegistry(
|
||||
storeModule.sourcesFrom(registryRows, shippedIds), { customSkills: [] });
|
||||
const falseShadows = built.diagnostics.filter((d) => d.kind === 'shadowed');
|
||||
record('a shipped agent published to the registry is not reported as overriding itself',
|
||||
falseShadows.length === 0,
|
||||
falseShadows.map((d) => d.agentId).join(', ') || 'no false overrides');
|
||||
record('...and an authored agent still appears beside the shipped ones',
|
||||
built.agents.some((a) => a.id === 'authored-example')
|
||||
&& built.agents.length === agentsModule.AGENTS.length + 1,
|
||||
`${built.agents.length} agents from ${registryRows.length} rows`);
|
||||
|
||||
/* A genuine personal override of a shipped id is still reported — the
|
||||
diagnostic is useful, it was only being raised for the wrong rows. */
|
||||
const overridden = agentsModule.readAgentRegistry(
|
||||
storeModule.sourcesFrom([{
|
||||
definition_id: agentsModule.AGENTS[0].id, visibility: 'personal',
|
||||
markdown: agentsModule.AGENTS[0].markdown,
|
||||
}], shippedIds), { customSkills: [] });
|
||||
record('a personal override of a shipped agent is still reported as one',
|
||||
overridden.diagnostics.some((d) => d.kind === 'shadowed'),
|
||||
overridden.diagnostics.map((d) => d.kind).join(', ') || 'none');
|
||||
|
||||
/* The seed must exercise every status, or none of the above can catch anything. */
|
||||
const seededStatuses = new Set(seedModule.seedData.JobApplication.map((a) => a.status));
|
||||
const neverSeeded = records.APPLICATION_STATUSES.filter((st) => !seededStatuses.has(st));
|
||||
|
||||
Reference in New Issue
Block a user