Skip to content

fix(knowledge): clarify temporal kind filters - #194995

Merged
obviyus merged 3 commits into
openclaw:mainfrom
saariuslystoned:codex/memory-temporal-kind-guidance-194974
Nov 8, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
saariuslystoned:codex/memory-temporal-kind-guidance-194974

Conversation

@saariuslystoned

@saariuslystoned saariuslystoned commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #194974.

What Problem This Solves

Temporal Knowledge tools accept an exact record.type filter, but their schemas did not explain that kind differs from the page/claim/relationship categories used by search and lookup. A copied kind: "claim" can therefore yield no dated decisions or events.

The shared temporal schema now describes that existing distinction for timeline, day, and since. The retrieval guide explains it too. Accepted values and filtering remain unchanged.

Evidence

Built Gateway proof: #194995 (comment)

Separate main/candidate Gateways delivered their actual tool_describe schemas to a local provider fixture. Main had no kind description; candidate names exact record types. All other input schema fields matched. Identical fixed queries over two claims published through knowledge_remember returned claim: 0, decision: 1, event: 1, and omitted-kind: 2 on both. This is a contract-text improvement, not a claim of changed model behavior or filtering.

Focused validation: chronicle suite (13 passed), provider-prefix stability suite (14 passed), scoped TypeScript, and touched-file lint (0 warnings/errors). The new contract guard fails on main because properties.kind.description is undefined. The added mock registration harness and allocation file were removed; its guard is consolidated into the existing suite, retaining both date-zone cases.

Delta against frozen main a599ca49348: production +6 net (7 added / 1 removed), tests 0 net, documentation +6. The small production growth is the one shared description; no new runtime machinery.

Original fix and documentation by @saariuslystoned; maintainer follow-up supplies built-Gateway proof and test consolidation.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: knowledge size: XS labels Nov 8, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds shared temporal-filter guidance and documentation explaining that kind matches record.type rather than record.kind.

Example: Query decisions and events dated 2026-10-04 with knowledge_chronicle_since.

  • Before: The undescribed kind field invites copying kind: "claim", which returns zero records.
  • After: The description explains using kind: "decision" for the decision or omitting kind for both records; filtering itself remains unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow, correct contract clarification supported by shipped-Gateway evidence and focused regression coverage; CI clearance remains separate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspected immutable CLI output shows the shared description on all three tools through a running built Gateway; obviyus additionally records delivery through tool_describe to a provider fixture and unchanged real Knowledge query results. The exercised production description is unchanged at the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Copying a successful search kind filter into a temporal query can misleadingly return no dated claims.
Reason: The clarification resolves a demonstrated contract ambiguity with no new option, retrieval policy, or runtime machinery.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR accurately clarifies an existing Knowledge contract that current main still leaves unexplained; no introduced defect was found.

Priority: P3
Reviewed head: 198e0afcfe048b5bf93a6ee12808fb3cf6afd631

Before merge

None.

Findings

None.

Agent review details

How this fits together

Knowledge exposes shared operation schemas through Gateway tool descriptors; temporal queries consume date and type filters and return eligible dated records.

flowchart LR
  A[Shared temporal schema] --> B[Gateway tool descriptors]
  B --> C[Agent query]
  C --> D[Knowledge service]
  D --> E[Scoped temporal retrieval]
  E --> F[Dated records]
Loading

Technical review

Best possible solution:

Merge the shared schema clarification and guide update while preserving the established filter semantics.

Do we have a high-confidence way to reproduce the issue?

Source confirms the missing main-branch description and differing filter comparisons; supplied Gateway traces demonstrate the distinction, but this read-only review ran no target code.

Is this the best way to solve the issue?

This is the smallest complete fix: explain exact type matching and omission behavior at the existing shared schema owner and in the retrieval guide.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f89b123d7fee.

Provenance checked

  • Temporal kind contract keeps the original intent (65ad180: The bundled Knowledge import retained the existing temporal API; its later derived-Timeline refactor preserved exact-type filtering and the no-kind rule for source grouping.)
  • Existing date-zone tests keeps the original intent (65ad180: The tests protect timestamp conversion into an IANA calendar day and retention of literal date-only values; both expectations survive consolidation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests 0, Docs +6. Total +12 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 7 1 +6
Tests 1 14 14 0
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 27 15 +12

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test growth Production +7/-1; tests +14/-14 The production growth supplies one shared user-facing description; test consolidation preserves existing date coverage without net growth.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: A focused guidance correction improves query ergonomics without changing working retrieval behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-08T04:17:24.046Z sha 137d398 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-08T05:34:16.195Z sha 137d398 :: needs maintainer review before merge. :: none

Reviewed November 8, 2026, 5:25 AM ET / 10:25 UTC (Revision 3).

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added actual shipped-Gateway/CLI proof for unchanged head 137d398ed80839087a44e1efd25eead82d517752 and updated the PR body. A fresh canonical baseline/config writer supplied state/provenance; the real built Gateway reached readiness; actual tools.catalog CLI calls exposed the guidance on all three Knowledge tools and omitted them with plugins excluded. The unchanged response checker and canonical cleanup passed (wrapper exit 0).

Immutable source-bound proof · sanitized actual command/output excerpt.

The separate proof-only commit leaves the code candidate unchanged. Normal plugin startup was used; side-effect services were skipped, with no model call, real memory, production installation or model-comprehension claim.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:docs Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:docs Preliminary submission classification; full source review pending. labels Nov 8, 2026
@obviyus

obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Built-Gateway contract proof (secretless node:24.22.1)

Base: a599ca49348f028d76113e2bb9d6c8f92e3877b6; candidate retains contributor commit 137d398ed80839087a44e1efd25eead82d517752. Both runtime builds succeeded. Separate fresh profiles used the shipped openclaw.mjs Gateway and gateway call chat.send/agent.wait, with a local OpenAI-compatible provider fixture. No real accounts or credentials were used.

The fixture requested the real tool_describe descriptors for knowledge_timeline, knowledge_chronicle_day, and knowledge_chronicle_since. The exact descriptors reached the fixture provider in subsequent role-tool messages (source: openclaw, sourceName: knowledge, IDs openclaw:knowledge:<tool-name>). For all three tools, the received properties.kind was:

// main
{"type":"string","maxLength":64}
// candidate
{"type":"string","maxLength":64,"description":"Exact record.type filter, such as decision, event, or meeting; unlike search/lookup kind (page, claim, relationship). Omit to include all eligible dated types."}

Removing only that description leaves every other input-schema field identical.

The same fixed tool-call sequence then published two fictional dated claims through the real knowledge_remember tool: a decision at 2026-10-04T10:00:00Z and an event at 2026-10-04T11:00:00Z. Both have record.kind: claim, but record.type: decision / event. knowledge_chronicle_since over that day returned:

kind argument main candidate
claim 0 0
decision 1 decision 1 decision
event (control) 1 event 1 event
omitted (control) both records both records

Within each lane, returned IDs matched the actual remember receipts. Record projections were identical across lanes apart from fresh-store UUIDs. This proves the contract-text improvement and unchanged filtering, not any model-behavior improvement: the fixture made identical predetermined queries on both. The existing filter remains the exact r.type === input.kind comparison in chronicle.ts:198; the docs describe that behavior accurately.

Simplification: removed the added mock plugin-registration harness and its test-line allocation; the metadata guard is consolidated into the existing chronicle suite, preserving both existing IANA-zone cases in a table. No runtime filtering, validation limits, defaults, or storage behavior changed.

@obviyus

obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Nov 8, 2026
@obviyus

obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

CI classification for exact head 198e0afcfe048b5bf93a6ee12808fb3cf6afd631:

  • OpenGrep job: failed in Install opengrep, before scanning any changed path. Its official release download returned HTTP504 on all five attempts; the subsequent missing-SARIF error is a consequence of no installed scanner.
  • CI core-2 job: the full core stripe failed in resolveDevTool because it could not stage the pinned Bun fork, before lint validation. The fallback diagnostic src:agents subdivision passed (two max-lines warnings, zero errors). This PR changes only the Knowledge schema description, its existing test, and guide; none can affect release downloads or Bun staging.
  • The CI gate reports those upstream failures, not an additional product failure. No CI test/validation jobs were cancelled. Five cancelled checks were superseded ancillary auto-response/dispatch/context runs, not selected test jobs.

Local candidate validation completed: 13 chronicle tests, 14 provider-prefix stability tests, scoped TypeScript, touched-file format/lint. The contract guard fails on frozen main because its kind description is absent. The built-Gateway contract/query proof is linked in the PR body. Fresh exact-head ClawSweeper review: 5/6, no findings.

Release recovery prerequisite: curl -sS -o /dev/null -w '%{http_code}' -L https://github.com/opengrep/opengrep/releases/latest returned 200 at 2026-11-08T10:32:35Z after once-per-minute checks. Both workflows' failed jobs were rerun exactly once following recovery; no source push or gate bypass was used.

The single allowed retry failed again before validation:

  • OpenGrep attempt 2: the same official binary download returned HTTP502 repeatedly plus a connection failure. No scan ran.
  • core-2 attempt 2: both the full stripe and its diagnostic subdivision failed staging the same pinned Bun fork; no lint finding was emitted.
  • CI gate attempt 2: downstream failure of selected hosted core lint.

No further rerun was requested. These are external tool-download infrastructure failures, not candidate validation failures.

@obviyus
obviyus merged commit 578e256 into openclaw:main Nov 8, 2026
222 of 233 checks passed
@obviyus

obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Landed in 578e256. Thanks @saariuslystoned. The temporal kind filter now documents that it matches record types.

vincentkoc added a commit that referenced this pull request Nov 8, 2026
…tooling-lint-selection-20261108

* commit 'b0e90e6a4b359fff7756698067fdce4758b1907b': (38 commits)
  fix(android): Talk button demands a realtime provider on a native Talk setup (#191194)
  chore: trace first-run Gateway work and verify later replies (#195185)
  fix(knowledge): keep deleted messages out of reply previews (#195126)
  fix(agents): preserve streamed replies across Gateway restarts (#195164)
  perf(ci): reuse SDK transport path boundaries (#195180)
  fix(sandbox): avoid pauses for unchanged command checkpoints (#195120)
  fix(test): make retention checks portable across runtimes (#195091)
  fix(knowledge): clarify temporal kind filters (#194995)
  improve: reduce Gateway allocation while draining SQLite receipts (#195129)
  fix: reduce streaming CPU after reply and voice directives (#195145)
  fix: reduce Markdown reparsing during streamed tool-call checks (#195161)
  fix: restore the main dead-export gate (#195158)
  improve(ci): pack small UI selections into fewer jobs (#195107)
  fix(muse): quota and sign-in failures end with no reply (#195148)
  fix: allow first release push with shipped patch bytes (#195174)
  fix(ci): narrow single-config tooling selections (#195147)
  fix(packaging): reject incompatible prepublish plugin cohorts (#195152)
  fix(ci): prepare verified Bun before parity checks (#195155)
  fix: Incognito agent turns stall before execution (#195005)
  fix: credentialed search and speech providers work without picking a provider (#195169)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 9, 2026
fix(knowledge): describe temporal kind filters as record types

The temporal Knowledge tools accepted `kind` as an undescribed string, but chronicle execution compares it to the record type (chronicle.ts), not to the page, claim or relationship categories that the grep and lookup tools use. A query such as kind:"claim" therefore matched nothing. The tool schema and docs now say that `kind` is an exact record type and give examples. Filtering is unchanged.

Evidence: a built Gateway with a real agent turn through the registered chronicle tool. The schema that the provider receives gives no guidance on main and names the record types with this change. kind:"claim" returns nothing and kind set to a real record type returns the dated records, on both main and this change. Details: openclaw#194995 (comment).

Thanks @saariuslystoned.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: knowledge proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs Bug]: Clarify Knowledge temporal kind versus search record kind

2 participants