feat: add experimental LCM task bridge suggestions (3/10)#518
feat: add experimental LCM task bridge suggestions (3/10)#518100yenadmin wants to merge 32 commits into
Conversation
569f9ca to
99e7440
Compare
Follow-up hardening updateRebuilt this branch on top of #517 and kept it intentionally inert/experimental. What changed:
Verification on head
No review threads are open. This remains draft because it is stacked after #516 and #517. |
Completion update — 2026-04-29Fresh Lexar checkout matched the upstream PR head before validation. No code changes were needed on this PR.
Local validation on fresh upstream-based Lexar checkout: npm test -- --run test/task-bridge-suggestion-store.test.ts test/observed-work-store.test.ts
# 9 passed
npm test
# 836 passed across 47 files
npm run build
# passed
git diff --check HEAD
# cleanScenario coverage:
Deferred to follow-up:
|
There was a problem hiding this comment.
Pull request overview
Implements an experimental, suggestion-only LCM ↔ OpenClaw task-bridge ledger (Option C) on top of newly added temporal rollups (lcm_recent) and observed work-density (lcm_work_density) read models, with updated tool-routing guidance and docs.
Changes:
- Adds rollup storage/build pipeline and tools:
lcm_recent(default) +lcm_rollup_debug(config-gated). - Adds observed-work density storage +
lcm_work_densitytool (read-only). - Adds inert task-bridge suggestion storage + review-state APIs, plus tests/spec/docs/changesets.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/task-bridge-suggestion-store.test.ts | Adds tests for task-bridge suggestion persistence + review states. |
| test/plugin-prompt-hook.test.ts | Updates assertions for revised recall-tool routing prompt text. |
| test/observed-work-store.test.ts | Adds tests for observed-work density store/tool behavior and source redaction. |
| src/tools/lcm-work-density-tool.ts | Introduces lcm_work_density tool with period/window filtering and redaction controls. |
| src/tools/lcm-rollup-debug-tool.ts | Adds config-gated operator tool for inspecting rollup state and provenance. |
| src/tools/lcm-recent-tool.ts | Implements lcm_recent with rollup preference + bounded leaf-summary fallback and budgeting. |
| src/timezone-windows.ts | Adds timezone-safe date/window helpers used by period resolution. |
| src/store/task-bridge-suggestion-store.ts | Adds inert task-bridge suggestion store (pending/accepted/rejected/dismissed/expired). |
| src/store/rollup-store.ts | Adds rollup persistence APIs and state/source management. |
| src/store/observed-work-store.ts | Adds observed-work item/source/state persistence and density query reads. |
| src/rollup-builder.ts | Adds daily + weekly/monthly rollup build logic and fingerprinting. |
| src/plugin/index.ts | Registers lcm_recent and lcm_work_density by default; gates lcm_rollup_debug. |
| src/engine.ts | Wires rollup stores/builders into ingest+maintain flows; exposes store accessors. |
| src/db/migration.ts | Adds migrations for rollups, observed work, and task-bridge suggestion tables + indexes/views. |
| src/db/config.ts | Adds rollupDebugEnabled config knob and env override. |
| specs/lcm-temporal-memory-plan.md | Documents temporal-memory implementation plan and rollout map. |
| specs/lcm-task-bridge-option-c-experimental.md | Documents Option C gates/non-goals and the inert scaffold behavior. |
| specs/lcm-observed-work-density-option-b.md | Documents Option B observed-work density model and tool contract. |
| skills/lossless-claw/references/recall-tools.md | Updates skill reference with availability-gated lcm_recent/debug guidance and proof rules. |
| skills/lossless-claw/SKILL.md | Updates skill overview and operating rules for temporal recall availability and proof-safe flows. |
| openclaw.plugin.json | Adds rollupDebugEnabled to plugin config schema/help. |
| docs/configuration.md | Documents LCM_ROLLUP_DEBUG_ENABLED / rollupDebugEnabled. |
| README.md | Documents LCM_ROLLUP_DEBUG_ENABLED environment flag. |
| .changeset/lcm-temporal-skill-docs.md | Changeset for skill/docs updates around temporal recall guidance. |
| .changeset/lcm-temporal-rollups.md | Changeset for temporal rollups + lcm_recent/lcm_rollup_debug. |
| .changeset/lcm-task-bridge-suggestions.md | Changeset for inert task-bridge suggestion storage. |
| .changeset/lcm-observed-work-density.md | Changeset for observed-work density model + tool. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Final adversarial pass - merge order 3/10, after #517Score: mergeability 9.7/10, functionality 9.0/10, description 9.8/10. Functionality audit: Works as an inert suggestion ledger. Suggestions require observed-work/source provenance, preserve reviewed rows, keep creator/reviewer metadata, and do not register runtime generation tools in this slice. The hardening made upsert results explicit: inserted, refreshed, or preserved-reviewed. Scenario coverage: Provides the storage foundation for reviewed task-action suggestions without giving LCM task authority. Final state: Residual caveat: Storage only. Suggestion tooling lands later in #539 and remains opt-in. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Final May 1 hardening/status update:
The PR description top note has been refreshed with current head SHA, visible-vs-logical LOC breakdown, scope, caveats, and validation status. LCM remains an evidence layer: recaps, observed work, events, episodes, and suggestions are entry points, not proof or task authority. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const aggregateResult = await this.rollupBuilder.buildWeeklyMonthlyRollups( | ||
| conversation.conversationId, | ||
| { daysBack }, | ||
| ); | ||
| const errorCount = rollupResult.errors.length + aggregateResult.errors.length; | ||
| if (errorCount > 0) { | ||
| markRollupRebuildPending("rollup-build-errors"); | ||
| } | ||
| this.deps.log.info( | ||
| `[lcm] maintain: rollups conversation=${conversation.conversationId} ${sessionLabel} dailyBuilt=${rollupResult.built} dailySkipped=${rollupResult.skipped} aggregateBuilt=${aggregateResult.built} aggregateSkipped=${aggregateResult.skipped} errors=${errorCount}`, |
| export function createLcmRollupDebugTool(input: { | ||
| deps: LcmDependencies; | ||
| lcm?: LcmContextEngine; | ||
| getLcm?: () => Promise<LcmContextEngine>; | ||
| sessionId?: string; | ||
| sessionKey?: string; | ||
| }): AnyAgentTool { | ||
| return { | ||
| name: "lcm_rollup_debug", | ||
| label: "LCM Rollup Debug", | ||
| description: | ||
| "Inspect temporal rollup state, recent rollups, and provenance sources without LLM calls.", | ||
| parameters: LcmRollupDebugSchema, |
| accounting: { | ||
| itemsIncluded: result.itemsIncluded, | ||
| itemsOmitted: result.itemsOmitted, | ||
| truncated: result.itemsOmitted > 0, | ||
| }, | ||
| confidence: "observed-unrefined", | ||
| disclaimer: "Observed from LCM evidence; not authoritative task state.", | ||
| recommendedDives: | ||
| result.density.unfinished > 0 | ||
| ? ["Inspect source evidence for unfinished items before claiming certainty."] | ||
| : [], | ||
| }, p.maxOutputTokens); |
PR #518: Task-bridge ledger: inert suggestion storage only
Maintainer Quick Read
acbc895525122261019f20b9c38e56a31b3b6eedWhy Maintainers Should Care
This creates a ledger for possible task actions suggested from LCM evidence, but keeps the bridge inert. It is the audit trail and review state, not an automation engine.
Stack Map
How It Works
What Ships In This PR
What This PR Intentionally Does Not Do
How An Agent Uses It
Engineering Boundaries
lcm_describe,lcm_expand,lcm_expand_query, raw messages, GitHub, logs, tickets, or the relevant authority.includeSourcesor debug affordance.Primary Review Files
src/store/task-bridge-suggestion-store.tssrc/db/migration.tstest/task-bridge-suggestion-store.test.tsSize And Review Surface
These are intentionally large LCM changes, so the body separates the GitHub-visible diff from the intended logical review slice. Later PRs target
main, which makes the GitHub Files tab include parent-stack code; reviewers should use the logical parent listed above when judging the slice.main#517Logical slice breakdown:
Review Concerns Already Folded Into The Code
julianday()correctness and now use matching expression indexes for indexed range/order plans.Validation Evidence
npm test -- --run test/task-bridge-suggestion-store.test.ts test/observed-work-store.test.tsnpm testnpm run buildgit diff --checktestcheck: successSuggested Maintainer Review Path
mainwhile the series is logically stacked.