You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+90-11Lines changed: 90 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Meadow supports AI agent-generated plans for batch modifications to works. The s
130
130
#### Data Model
131
131
132
132
**Plans** - High-level task definitions
133
-
-`prompt`: Natural language instruction (e.g., "Translate titles to Spanish in alternate_title field")
133
+
-`prompt`: Natural language instruction (e.g., "Add a date_created EDTF string for the work based on the work's existing description, creator, and temporal subjects")
134
134
-`query`: OpenSearch query string identifying target works
135
135
- Collection query: `"collection.id:abc-123"`
136
136
- Specific works: `"id:(work-id-1 OR work-id-2 OR work-id-3)"`
@@ -139,31 +139,110 @@ Meadow supports AI agent-generated plans for batch modifications to works. The s
139
139
**PlanChanges** - Work-specific modifications
140
140
-`plan_id`: Foreign key to parent plan
141
141
-`work_id`: Specific work being modified
142
-
-`changeset`: Map of field changes tailored to this work
142
+
-`add`: Map of values to append to existing work data
143
+
-`delete`: Map of values to remove from existing work data
144
+
-`replace`: Map of values to fully replace in work data
143
145
-`status`: Individual approval/rejection tracking
144
146
145
-
#### Example Workflow
147
+
Each PlanChange must specify at least one operation (`add`, `delete`, or `replace`).
146
148
149
+
#### PlanChange payloads
150
+
151
+
-`add` merges values into existing metadata. For lists (like subjects or notes) the values are appended when they are not already present. Scalar fields (e.g., `title`) are merged according to the context (`:append` for `add`, `:replace` for `replace`).
152
+
-`delete` removes the provided values verbatim. For controlled vocabularies this means the JSON structure must match what is stored in the database (role/term maps). The planner normalizes structs and string-keyed maps automatically when executing changes.
153
+
-`replace` overwrites existing values for the provided keys. Use this when the existing content should be replaced entirely instead of appended or removed.
154
+
155
+
Controlled metadata entries (subjects, creators, contributors, etc.) follow the shape below. For subjects you must supply both the `role` (with at least `id`/`scheme`) and the `term.id`; extra fields such as `label` or `variants` are ignored during execution but can be included when working with structs in IEx:
When constructing PlanChanges you can mix-and-match operations as needed. For example, to remove an outdated subject and add a new one in a single change:
0 commit comments