write_memory
Persist hypotheses, fix logs, or pending work across sessions by creating or replacing one top-level value in reforge-state.json through a staged write.
Instructions
Create or replace one top-level value in reforge-state.json via a staged write. Use when: you need to persist a hypothesis, fix log or pending work across sessions. Don't use when: you only need to inspect a stored value (use read_memory instead).
Returns {success, key, previous_value}, with error on an OSError while saving. previous_value is null for an absent key or a previously null value. Repeated calls can change previous_value and rotate timestamped state backups, so this is not idempotent even when the supplied value is unchanged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Top-level state key to create or replace; arbitrary strings are accepted, e.g. pending_fixes. This is a literal key, not a dotted path. | |
| value | Yes | Required JSON value to store: object, array, string, number, boolean or null. Replaces the entire value at key rather than merging/appending. Example for pending_fixes: ['split handlers.py']. | |
| repo_path | Yes | Existing directory containing reforge-state.json; prefer an absolute path. Writes through reforge-state.tmp, replaces the state file and rotates up to five timestamped backups; other top-level keys are preserved. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| error | No | ||
| success | Yes | ||
| previous_value | Yes |