Accept echoed category for record forgets

d7dee614af2e · AtlantisPleb · · parent 853c2de48282

Accept echoed category for record forgets

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified lib/openagents/tools/memory_forget.ex
  • modified test/openagents/tools/profile_memory_tools_test.exs

Diff

2 files changed, +11 -6

lib/openagents/tools/memory_forget.ex modified +10 -5

@@ -7,6 +7,9 @@ defmodule OpenAgents.Tools.MemoryForget do

7 7
  alias OpenAgents.ProfileMemory
8 8
  alias OpenAgents.Tools.{ExecutionResult, MemoryContext, MemoryContract}
9 9
10
  @categories ~w(name role project preference constraint other)
11
  @record_categories ["" | @categories]
12
10 13
  @impl true
11 14
  def specification do
12 15
    MemoryContract.tool(

@@ -16,7 +19,9 @@ defmodule OpenAgents.Tools.MemoryForget do

16 19
        "authorizes it. Mode all (with empty record_id, category, claim, and " <>
17 20
        "expected_generation 0) forgets everything without listing first; mode " <>
18 21
        "category clears one category; mode record needs the exact record_id, " <>
19
        "stored claim wording, and expected_generation",
22
        "stored claim wording, and expected_generation. Record mode may repeat " <>
23
        "the selected record category; the record ID and generation remain the " <>
24
        "authority fence",
20 25
      input_schema(),
21 26
      output_schema(),
22 27
      :reversible_write,

@@ -60,12 +65,12 @@ defmodule OpenAgents.Tools.MemoryForget do

60 65
  defp selector(%{
61 66
         "mode" => "record",
62 67
         "record_id" => record_id,
63
         "category" => "",
68
         "category" => category,
64 69
         "claim" => claim,
65 70
         "expected_generation" => expected_generation
66 71
       })
67
       when is_binary(record_id) and is_binary(claim) and is_integer(expected_generation) and
68
              expected_generation > 0 do
72
       when is_binary(record_id) and category in @record_categories and is_binary(claim) and
73
              is_integer(expected_generation) and expected_generation > 0 do
69 74
    with {:ok, parsed_id} <- Ecto.UUID.cast(record_id),
70 75
         true <- byte_size(claim) in 1..500 do
71 76
      {:ok,

@@ -86,7 +91,7 @@ defmodule OpenAgents.Tools.MemoryForget do

86 91
         "claim" => "",
87 92
         "expected_generation" => 0
88 93
       })
89
       when category in ~w(name role project preference constraint other),
94
       when category in @categories,
90 95
       do: {:ok, %{"mode" => "category", "category" => category}, category}
91 96
92 97
  defp selector(%{
test/openagents/tools/profile_memory_tools_test.exs modified +1 -1

@@ -107,7 +107,7 @@ defmodule OpenAgents.Tools.ProfileMemoryToolsTest do

107 107
               call("memory_forget", %{
108 108
                 "mode" => "record",
109 109
                 "record_id" => record.id,
110
                 "category" => "",
110
                 "category" => "preference",
111 111
                 "claim" => record.claim,
112 112
                 "expected_generation" => record.generation
113 113
               }),

This page updates live while a promote is in flight · changelog