add_relations
Batch-add up to 50 ontology relations in one call, reducing round-trips. Processes each row idempotently and returns detailed per-row errors and suggestions.
Instructions
Batch-add multiple relations in one call — same per-row shape as add_relation. Use after analyze_repo_structure or another review flow when the agent has K semantic edges accepted by the user — replaces K×add_relation round-trips. Inferred module edges are not accepted merely because imports exist; review exact evidence and include the required nonblank why for every new depends_on. Each row is processed independently and idempotently: existing edges return {ok: true, alreadyExists: true}; missing source/target slugs / unknown type / non-object row shape / unknown row fields surface as {ok: false, error} with a relations[n] row label and structured rowName; unknown type rows include a closest-value hint with structured valueName / receivedValue / suggestion / allowedValues; single unknown-field rows include receivedField plus one-row unknownFields; multi unknown-field rows report every unknown field with nearest hints, allowedFields, receivedFields, and Received fields: .... relations[] order in the response matches the input. Cap = 50 per call. NO atomic rollback — for all-or-nothing semantics use single add_relation calls. Tip: avoid expected_mtime in batch when multiple rows share the same from slug — the first row mutates that file so the second would see a stale mtime. Invalid-only batches return no row-level changed / alreadyExists write metadata and no top-level postWriteMaintenance. When at least one row changes the vault, the response includes one compact postWriteMaintenance (maintenance_plan) with count-safe byPhase / bySeverity / byKind queue buckets, action score, executable proposedAction, and current-page nextExecutableAction / nextReviewAction pointers for the final graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes | Array of relation specs (max 50). Each row uses the same shape as `add_relation` input. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes | ||
| postWriteMaintenance | No | Compact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write. |