Skip to content

fix(memory-wiki): keep claim freshness tied to evidence timestamps - #97465

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
ly-wang19:fix/memory-wiki-claim-freshness-fallback
Jun 28, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
ly-wang19:fix/memory-wiki-claim-freshness-fallback

Conversation

@ly-wang19

@ly-wang19 ly-wang19 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Memory-wiki claim freshness should prefer explicit claim/evidence timestamps. The old path could fall back to page-level freshness even when a claim carried malformed timestamp data, which can hide bad claim metadata as a page-level stale/fresh result.

This replaces the earlier attempt in #97420, which was closed only by the author queue limit after review pressure, not because the patch was invalid.

Why This Change Was Made

The fix keeps page updatedAt as a fallback only for claims with no explicit claim/evidence timestamp fields. If the claim provides timestamp metadata but it is malformed, the result stays unknown instead of silently using page freshness.

User Impact

Memory-wiki health reports better distinguish untimestamped claims from claims with broken timestamp metadata. That makes freshness signals more trustworthy without changing the healthy explicit-timestamp path.

Evidence

  • git diff --check
  • node scripts/run-vitest.mjs extensions/memory-wiki/src/claim-health.test.ts
  • .agents/skills/autoreview/scripts/autoreview --mode local

Autoreview result: clean; no accepted/actionable findings. The reviewer confirmed explicit claim/evidence timestamps remain authoritative, malformed explicit timestamps stay unknown, and page freshness is only a fallback when timestamps are absent.

After-fix Real Behavior Proof

Ran a real memory-wiki compile against a temporary vault on this PR branch. The vault had two claims on a page with fresh page-level updatedAt:

  • claim.malformed-explicit: claim/evidence timestamp fields present but malformed.
  • claim.untimestamped: no claim/evidence timestamp fields, so it should still use page freshness.

Command shape: node --import tsx ... compileMemoryWikiVault(config) with render.createDashboards=true, then read reports/claim-health.md and .openclaw-wiki/cache/claims.jsonl from the compiled vault.

Redacted terminal output:

{
  "rootDir": "<redacted-temp-vault>",
  "compiledClaimCount": 2,
  "reportPath": "reports/claim-health.md",
  "reportClaimHealthLines": [
    "- Stale or unknown claims: 1",
    "- [Claim Freshness Proof](../entities/claims.md): `claim.malformed-explicit`: Malformed explicit timestamp should not inherit page freshness. (status supported, 1 evidence, missing updatedAt)"
  ]
}

This proves the generated claim-health report path now surfaces the malformed explicit timestamp as unknown while the untimestamped claim is not listed as stale/unknown and continues to inherit the fresh page timestamp.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 6:12 AM ET / 10:12 UTC.

Summary
The branch changes memory-wiki claim freshness so claim/evidence timestamps win over page freshness, page updatedAt is only an untimestamped-claim fallback, and focused unit coverage is added.

PR surface: Source +13, Tests +100. Total +113 across 2 files.

Reproducibility: yes. Current main passes page updatedAt into claim freshness candidates, and the PR body provides after-fix live output from a real memory-wiki compile showing the changed malformed-versus-untimestamped behavior.

Review metrics: 1 noteworthy metric.

  • Claim freshness fallback: 1 fallback narrowed. Page updatedAt now remains a fallback only when claim/evidence timestamp fields are absent, which changes generated health semantics for malformed explicit metadata.

Stored data model
Persistent data-model change detected: unknown-data-model-change: extensions/memory-wiki/src/claim-health.test.ts, vector/embedding metadata: extensions/memory-wiki/src/claim-health.test.ts, vector/embedding metadata: extensions/memory-wiki/src/claim-health.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #97465
Summary: This PR is the active replacement for an earlier closed, unmerged same-author attempt at the memory-wiki claim freshness behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Existing memory-wiki claims with malformed explicit claim/evidence updatedAt fields will become unknown instead of inheriting page freshness, which can add health/lint warnings and affect query or digest ordering.

Maintainer options:

  1. Accept stricter malformed metadata handling (recommended)
    Maintainers can intentionally accept that malformed explicit claim/evidence timestamp metadata now surfaces as unknown freshness while untimestamped claims still inherit page freshness.
  2. Pause for compatibility policy
    If existing malformed metadata should keep page freshness during upgrade, pause this PR and ask for an explicit migration or compatibility design.

Next step before merge

  • [P2] No narrow automated repair is identified; the remaining action is maintainer review of the compatibility-sensitive freshness behavior before merge.

Security
Cleared: The diff only changes memory-wiki TypeScript freshness logic and colocated unit tests; it does not touch dependencies, workflows, secrets, package metadata, or code-download paths.

Review details

Best possible solution:

Land the claim-health-local fix after maintainers accept the stricter malformed-timestamp semantics; keep page freshness as the fallback only for truly untimestamped claims.

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

Yes. Current main passes page updatedAt into claim freshness candidates, and the PR body provides after-fix live output from a real memory-wiki compile showing the changed malformed-versus-untimestamped behavior.

Is this the best way to solve the issue?

Yes. assessClaimFreshness is the shared classifier used by reports, lint, query ranking, and digests, so fixing the timestamp precedence there avoids duplicated policy in callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8d168c836af3.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live output is present: the PR body shows a redacted real memory-wiki compile where malformed explicit timestamps become unknown and untimestamped claims still use page freshness.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient live output is present: the PR body shows a redacted real memory-wiki compile where malformed explicit timestamps become unknown and untimestamped claims still use page freshness.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a normal-priority memory-wiki correctness fix with limited blast radius across claim health, lint, query ranking, and digest output.
  • merge-risk: 🚨 compatibility: The PR changes existing malformed claim/evidence timestamp metadata from page-freshness fallback to unknown freshness, changing generated health and lint output for those users.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient live output is present: the PR body shows a redacted real memory-wiki compile where malformed explicit timestamps become unknown and untimestamped claims still use page freshness.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live output is present: the PR body shows a redacted real memory-wiki compile where malformed explicit timestamps become unknown and untimestamped claims still use page freshness.
Evidence reviewed

PR surface:

Source +13, Tests +100. Total +113 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 6 +13
Tests 1 102 2 +100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 121 8 +113

What I checked:

Likely related people:

  • giodl73-repo: Current-main blame for assessClaimFreshness points to the merged refactor commit 4010b81a77f40c17ebfc55a6b47571dc1ef92902, and live PR metadata shows that change came through Refactor external plugin catalog toward feeds #95846. (role: recent area contributor; confidence: high; commits: 4010b81a77f4; files: extensions/memory-wiki/src/claim-health.ts, extensions/memory-wiki/src/compile.ts, extensions/memory-wiki/src/lint.ts)
  • vincentkoc: Commit 44fd8b0d6e38fcc371cb367ca5972297928331c6 introduced the claim-health report and the memory-wiki freshness consumers that this PR changes. (role: feature introducer; confidence: high; commits: 44fd8b0d6e38; files: extensions/memory-wiki/src/claim-health.ts, extensions/memory-wiki/src/compile.ts, extensions/memory-wiki/src/lint.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 28, 2026
@ly-wang19

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 28, 2026
@vincentkoc
vincentkoc merged commit 630034e into openclaw:main Jun 28, 2026
162 of 175 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 29, 2026
…penclaw#97465)

* fix(memory-wiki): keep claim freshness tied to evidence

* fix(memory-wiki): preserve page freshness fallback only for untimestamped claims

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
…penclaw#97465)

* fix(memory-wiki): keep claim freshness tied to evidence

* fix(memory-wiki): preserve page freshness fallback only for untimestamped claims

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 4, 2026
…penclaw#97465)

* fix(memory-wiki): keep claim freshness tied to evidence

* fix(memory-wiki): preserve page freshness fallback only for untimestamped claims

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
(cherry picked from commit 630034e)
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 8, 2026
…penclaw#97465)

* fix(memory-wiki): keep claim freshness tied to evidence

* fix(memory-wiki): preserve page freshness fallback only for untimestamped claims

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
(cherry picked from commit 630034e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-wiki merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants