Repository navigation
The docs say that memory.apply refuses an unknown key inside target or an action block - #2302
Merged
Merged
Conversation
…r an action block The nested objects of memory.apply refuse a key they have no field for with 422 VALIDATION_FAILED and the key's path, so a misspelt predicate cannot widen a filter. The pages stated one rule for every input model: an unknown key is ignored and named in ignored_args. - docs/reference/http-api.md: "Unknown and removed fields" scopes that rule to top-level keys. One bullet states the refusal, its entry in detail.errors, that it holds with dry_run on or off, and that a field removed from one of these objects is refused, not served. - docs/features/memory/writing.md: the memory.apply row names the refusal. - docs/architecture/system-overview.md: the same scope, and one sentence on the refusal. - docs/architecture/rolling-upgrades.md: a rule for the rollout. The build before drops such a key and runs the call on what is left, so a client sends only documented keys while both builds serve, and rule 12 does not hold inside these objects. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Both sides added a rule at the end of the list in docs/architecture/rolling-upgrades.md. The stewardship rule keeps its number and the memory.apply rule follows it. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #2155
Related: #2171
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Not required.
Why
memory.applyrefuses a key it has no field for insidetarget,target.filter,target.searchand theexpire,lock,labelanddemoteblocks: the seven nested models setextra="forbid"(server/memory/api/models_apply.py). The change that added the refusal touched no page, and the pages stated one rule for every input model: an unknown key is ignored and named inignored_args. A reader of those pages expects a misspelt predicate such astarget.filter.tag_anyto be served and reported, and it is a 422.docs/reference/http-api.md, "Unknown and removed fields"422 VALIDATION_FAILED, an entry indetail.errorsof typeextra_forbiddenwhoselocis the key's path, withdry_runon or off, and the reason (a filter the caller did not write must not select rows). A field removed from one of these objects is refused, not served and named inignored_args.docs/features/memory/writing.mdmemory.applyrow names the refusal and links to that section.docs/architecture/system-overview.mddocs/architecture/rolling-upgrades.mdEach statement was read in the code and its tests first. Where they say something narrower than a plain reading of the issue, the pages follow them:
server/transport/arg_feedback.py:unknownmapstarget.filter.tag_anytotarget.filter.tags_any, with a corrected example call). The HTTP 422 names the path and the type and carries no suggestion. The HTTP page says so and links to the MCP page, whose "Errors" section already covers nested keys.memory.applykeeps the general rule: served and named inignored_args, or422 UNKNOWN_ARGUMENTfor a near miss. The pages do not restate it for this op.Scope and risk
Touches four pages under
docs/: 32 lines added, 6 removed. No code, no test and no generated page changes.Left alone:
docs/reference/operations/memory.md(generated): no model comment changed, andpython -m scripts.codegen.docs_reference --checkreports every page current.docs/reference/mcp.mdanddocs/reference/errors.md: their text on validation failures already holds for a nested key.knowledge.source.add,knowledge.source.update,knowledge.source.worker_preview,knowledge.source.worker_registerandnamespace.registerthat setextra="forbid"refuse as before; the rest ignore an unknown key, andignored_argslists top-level keys only. Refusing there is a change of behaviour, not of text.i18n/: the translation workflow reads the English pages after the merge.What could break: a statement that is wrong. The rolling-upgrade rule is written as rule 88, the next after the last on
mainat this head. The list is sequential, so the formatter renumbers it when this lands after another change that adds a rule; no other text refers to its number.Compatibility, rollout and rollback
Tests
No new test: the change is prose. The behaviour's tests are on
main(tests/unit/test_memory_apply.py,tests/unit/test_arg_feedback.py), and the docs tests cover links, anchors and public copy.What ran, with
pytest -n 2. The branch mergesmainonce, to resolve a conflict in the rule list ofrolling-upgrades.md. The docs tests and Prettier on that page ran again on the merged head; the other lines ran before the merge:tests/unit/test_doc_links.py tests/unit/test_public_copy.py: 306 passed.tests/unit/test_memory_apply.py tests/unit/test_arg_feedback.py -k "nested or unknown", the cases the pages describe (the refusal over HTTP and MCP withdry_runon and off, the path inloc, the suggestion and the example over MCP, a top-level key still served or refused as before): 19 passed.test_package_contracts.py,test_op_transport_contract.py,test_tunable_constants.py,test_store_names_refused.py,test_degraded_unnoted.py,test_agent_instructions.py) andtests/analyzer: 307 passed, 12 skipped (the analyzer cases that need a ClickHouse).npx prettier@3.9.9 --checkon the four pages: pass. In the table ofwriting.mdonly thememory.applyrow differs.python -m scripts.codegen.docs_reference --check: every page current,docs/reference/http-api.mdincluded (the edit is outside its generated region).make typecheck: pass..claude/skills/loom-writing/scripts/check_prose.pyon the four pages, the commit message and this description: no hit.One reading of the code backs the scope sentence: no registered op's top-level input model sets
extratoforbidorallow, so "an op's input model ignores a top-level key it has no field for" holds for every op.Not run:
make lintandmake format-checkas a whole:make lintruns the Rust SDK generator's check, which needsrustfmt, andmake format-checkneedsshfmt; this machine has neither. No Python, shell, TOML or frontend file changed.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the text, read each statement in the code and its tests, and ran the checks listed under Tests.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Unticked: this change has no generated file, no migration, no shipped plugin file and no frontend file, so those four checks do not apply; the CLA line is the committer's to confirm. The first box is ticked with the two gaps named under "Not run":
make lintandmake format-checkstop on tools this machine lacks.🤖 Generated with Claude Code
Note
Low Risk
Documentation-only edits to four markdown files; no wire, code, or migration changes.
Overview
Documentation now matches existing server behavior:
memory.applynested payloads are not covered by the general “unknown top-level key →ignored_args” rule.Updates clarify that
target,target.filter,target.search, and theexpire,lock,label, anddemoteblocks reject any unrecognized key at validation with 422VALIDATION_FAILED(HTTP details includeextra_forbiddenand the key path inloc; MCP may suggest a near miss). Thehttp-api“Unknown and removed fields” section is scoped to top-level keys; removed fields inside those nested objects are refused rather than ignored.writing.mdlinksmemory.applyto that section.system-overview.mdnotes the exception so readers do not expect misspelled filter predicates to widen selection silently.rolling-upgrades.mdadds rule 88: during mixed N/N-1 fleets, older builds strip unknown nested keys and still run the call—so the same request can 422 on N and execute on N-1; rule 12 does not apply inside these objects for forward-added fields.Reviewed by Cursor Bugbot for commit ba787be. Bugbot is set up for automated code reviews on this repo. Configure here.