feat: implement LCM architecture follow-up (draft)#526
Conversation
|
Implementation follow-up status:
Safety boundaries remain intact: observed-work extraction is deterministic, |
There was a problem hiding this comment.
Pull request overview
Implements the “LCM ultimate architecture” follow-up atop the temporal rollups + observed-work + inert task-bridge stack by adding deterministic extraction during maintain(), new read tools for observed work and event cues, and opt-in inert task-suggestion tooling with default source redaction.
Changes:
- Add observed-work extraction + event observation extraction from new leaf summaries during engine maintenance, with per-conversation processing state.
- Add new tools:
lcm_work_density,lcm_event_search, opt-inlcm_task_suggestions/lcm_task_suggestion_review, plus config-gatedlcm_rollup_debug. - Extend migrations, config surfaces, specs/docs, and tests to cover the new LCM read models and tool gating/redaction behavior.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/task-bridge-suggestion-store.test.ts | Adds suggestion-ledger store tests |
| test/plugin-prompt-hook.test.ts | Updates recall-policy prompt expectations |
| test/observed-work-store.test.ts | Adds observed-work store/tool tests |
| test/lcm-ultimate-architecture.test.ts | End-to-end extraction/tool behavior tests |
| src/tools/lcm-work-density-tool.ts | Implements lcm_work_density tool |
| src/tools/lcm-task-suggestions-tool.ts | Implements inert suggestion/review tools |
| src/tools/lcm-rollup-debug-tool.ts | Implements lcm_rollup_debug tool |
| src/tools/lcm-event-search-tool.ts | Implements lcm_event_search tool |
| src/timezone-windows.ts | Adds/extends timezone window helpers |
| src/store/task-bridge-suggestion-store.ts | Adds suggestion ledger store |
| src/store/rollup-store.ts | Adds rollup store helpers/queries |
| src/store/observed-work-store.ts | Adds observed-work read model store |
| src/store/index.ts | Exports new stores/types |
| src/store/event-observation-store.ts | Adds event observation store |
| src/rollup-builder.ts | Rollup build logic + state updates |
| src/plugin/index.ts | Registers new tools + prompt text |
| src/observed-work-extractor.ts | Deterministic leaf-summary extraction |
| src/engine.ts | Wires stores/builders into engine + maintain() |
| src/db/migration.ts | Adds rollup/observed-work/event/suggestion tables |
| src/db/config.ts | Adds config toggles + env overrides |
| specs/lcm-ultimate-architecture-plan.md | Adds canonical architecture spec |
| specs/lcm-temporal-memory-plan.md | Updates temporal-memory plan/map |
| specs/lcm-task-bridge-option-c-experimental.md | Updates task-bridge spec details |
| specs/lcm-observed-work-density-option-b.md | Updates observed-work spec details |
| skills/lossless-claw/references/recall-tools.md | Updates recall tool guidance |
| skills/lossless-claw/SKILL.md | Updates skill guidance + routing |
| openclaw.plugin.json | Adds config schema/labels for toggles |
| docs/configuration.md | Documents rollup debug toggle |
| README.md | Documents new env vars/toggles |
| .changeset/lcm-ultimate-architecture.md | Changeset for architecture follow-up |
| .changeset/lcm-temporal-skill-docs.md | Changeset for skill doc updates |
| .changeset/lcm-temporal-rollups.md | Changeset for temporal rollups/tools |
| .changeset/lcm-task-bridge-suggestions.md | Changeset for suggestion ledger |
| .changeset/lcm-observed-work-density.md | Changeset for observed-work density |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Completion / review-thread triage update for head Implemented and verified in this slice:
Review threads addressed and resolved: 6/6. No unresolved review threads remain. Verification:
Scope caveat: this remains LCM evidence/observation/suggestion infrastructure. It does not grant LCM task authority, does not write Cortex/OpenClaw tasks, and keeps exact proof routed through source drilldown. |
|
Decomposition status update: this PR is now intentionally a draft/reference branch, not the merge candidate. The over-broad integration work has been split into reviewable follow-up slices:
The current merge path remains #516 -> #517 -> #518, then the narrow follow-ups above. The old #526 branch stays useful as an integration/reference artifact but should not be merged as-is. Latest cleanup applied across the split stack:
|
Final adversarial pass - keep draft/referenceScore: mergeability 6.5/10 as a production PR, functionality 8.3/10 as an integration oracle, description 9.8/10. Functionality audit: This branch is green and useful as an end-to-end architecture/reference branch. It now includes the same key hardening from the split stack: temporal aggregate fix, event-extraction atomicity, source caps, preserved-reviewed task suggestion accounting, deterministic date-window tests, and ultimate-architecture topic-key alignment. Scenario coverage: Demonstrates the full intended architecture in one place: temporal recap, observed-work extraction, event search, task suggestions, topic matching, and maintenance wiring. Final state: Recommendation: Do not merge #526 by default. Keep it as a draft/reference/oracle branch and land the decomposed production path: #516 -> #517 -> #518 -> #537 -> #538 -> #539 -> #540 -> #530 -> #531 -> #532. |
|
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. |
PR #526: Draft integration/oracle branch: reference only, not the merge vehicle
Maintainer Quick Read
3b4398007e96daf70203e74081b4789144c77e12Why Maintainers Should Care
This branch shows the broad architecture in one place, which is useful for comparison, but it is not the recommended production merge path. The decomposed PRs above are smaller, better hardened, and easier to review.
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
Size 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.mainmainLogical slice breakdown:
Review Concerns Already Folded Into The Code
julianday()correctness and now use matching expression indexes for indexed range/order plans.Validation Evidence
testcheck: successSuggested Maintainer Review Path
mainwhile the series is logically stacked.