Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
<!-- doc-head: public MemoryMaster release history through v4.8.4 -->
Covers user-visible changes, migrations, governance boundaries, and operational fixes for each release.
Key terms: graph observations, compiled profile, governed capture, recall, sensitivity, lineage.
<!-- doc-head: public history through v4.8.4 plus unreleased Workflow Intelligence -->
Covers user-visible changes, migrations, governance boundaries, workflow analytics, and operational fixes.
Key terms: workflow intelligence, rule observations, graph observations, governed capture, recall, lineage.
Read when upgrading MemoryMaster, preparing release notes, or checking migration and rollback impact.
<!-- /doc-head -->

# Changelog

## [Unreleased]

- Added on-demand **Workflow Intelligence** for Claude Code, Codex, and
Wezbridge histories. It uses a rebuildable WAL-mode sidecar, bounded redacted
excerpts, deterministic trajectory signals, self-contained local reports,
inert candidates, and explicit human review. LLM classification is opt-in and
cannot establish success or recurrence.
- Added migration `0024_rule_observation_lineage` with SQLite/Postgres parity.
New governed skill candidates require three distinct human root sessions;
user/global patterns also require two projects. Same-session retries and
subagent/automation activity do not inflate independent support.
- Added a fail-soft, content-free completion receipt hook. It ships
unregistered and defaults to `off`; shadow setup is explicit, advisory setup
fails closed until the 14-day/100-receipt/provider/precision gate passes, and
no blocking or automatic policy promotion exists.
- This entry is implementation evidence only. No package release, hook
installation, scheduler activation, deployment, or external acceptance is
implied.

## [4.8.4] - 2026-08-19

- **A correction aimed at another agent's claim is recorded instead of
Expand Down
18 changes: 10 additions & 8 deletions DOCS-MAP.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<!-- doc-head: canonical map through v4.8.4; Dreaming V1 stays shadow by operator ruling -->
<!-- doc-head: canonical map through the unreleased Workflow Intelligence implementation -->
# DOCS-MAP - memorymaster
# Covers: trust verdicts and replacements for every canonical documentation surface.
# Key terms: CURRENT, SUPERSEDED, compiled user profile, roadmap, ADR.
# Key terms: CURRENT, SUPERSEDED, workflow intelligence, compiled user profile, roadmap, ADR.
# Read when: locating authoritative project documentation before reading doc bodies.
# Updated: 2026-08-21 for version truthing; GLM retired, Dreaming shadow-only.
# Updated: 2026-08-30 for Workflow Intelligence, rule lineage, and sidecar ADR.
# Rule: generated profiles are disposable projections; MemoryMaster remains authority.
<!-- /doc-head -->

| File | Verdict | Last change | Reason |
|---|---|---|---|
| CHANGELOG.md | CURRENT | 2026-08-19 | Public release history through v4.8.4, matching `pyproject.toml`. Earlier heads said v4.7.5; the entries were there, the verdict line was stale. |
| README.md | CURRENT | 2026-08-13 | Primary product overview and setup for governed claims, PPR-7 observations, compiled profile, and release-first scheduled review. Its "Gemini plus GLM" wording predates the 2026-08-21 GLM retirement (#226) and needs a pass. |
| ROADMAP.md | CURRENT | 2026-08-21 | Sole authoritative roadmap; P5 merged and locally deployed, isolated PPR-7 active, and Dreaming V1 recorded as the main active workstream held in shadow by operator ruling. |
| README.md | CURRENT | 2026-08-30 | Primary product overview for governed claims plus the optional non-authoritative Workflow Intelligence sidecar; hook activation remains separate. |
| ROADMAP.md | CURRENT | 2026-08-30 | Sole authoritative roadmap; records Workflow Intelligence as locally implemented but unreleased/uninstalled and preserves separate shadow/advisory decisions. |
| docs/workflow-intelligence.md | CURRENT | 2026-08-30 | Operator and architecture contract for local trajectory analytics, deterministic evidence, inert candidates, and the off/shadow/advisory receipt gate. |
| docs/adr/0016-workflow-analytics-uses-disposable-sidecar.md | CURRENT | 2026-08-30 | Accepted boundary: authoritative memory remains one database while rebuildable workflow analytics use a non-authoritative local sidecar. |
| .planning/GRAPH-OBSERVATIONS-V1.md | CURRENT | 2026-08-12 | Bounded PPR-7 implementation ledger for deterministic supported components, governed synthesis, lifecycle, opt-in recall, and verification. |
| .planning/COMPILED-USER-PROFILE-V1.md | CURRENT | 2026-08-12 | Implementation contract for the zero-curation, evidence-bound user profile projection and weekly GLM map/reduce job. |
| .planning/PAPER-RADAR-REVIEW-2026-08-08.md | CURRENT | 2026-08-08 | Primary-paper ledger covers 57-paper triage, 18 deep reviews, exact MemoryMaster gaps, and ordered PPR-1 through PPR-6 decisions subordinate to ROADMAP.md. |
| .planning/PAPER-RESEARCH-IMPLEMENTATION-2026-08-08.md | CURRENT | 2026-08-08 | Executable status ledger for PPR-1 through PPR-6; records acceptance criteria and evidence without competing with ROADMAP.md. |
| .planning/HERMES-SCOPE-SKILLS-INTEGRATION-2026-08-07.md | CURRENT | 2026-08-12 | Executable Tencent-derived ledger; repair5 passed and PR #189 is open without merge authority. |
| .planning/audits/2026-08-07-hermes-scope-skills/audit-delta.md | CURRENT | 2026-08-12 | Bounded delta preserves failed runs and records repair5 pass plus PR #189 creation. |
| docs/governed-skills.md | CURRENT | 2026-08-08 | Operator guide for proposal/promotion, progressive confirmed-skill recall, isolation, and staging-only export. |
| docs/governed-skills.md | CURRENT | 2026-08-30 | Operator guide for three-human-root recurrence, human promotion, confirmed-skill recall, isolation, and staging-only export. |
| .planning/AUTORESEARCH-PROGRAM-2026-08-03.md | CURRENT | 2026-08-04 | Completed six-phase execution overlay records retrieval, graph, capture, full-QA, OAuth quality, public release, and the sole remaining longitudinal gate. |
| .planning/audits/2026-08-04-autoresearch-convergence/audit-delta.md | CURRENT | 2026-08-04 | Bounded convergence delta records SQLite-only tests, 40-case quality evidence, public v4.6.0 release evidence, and the remaining seven-day observation. |
| COMPETITOR_ANALYSIS.md | CURRENT | 2026-07-27 | Current prior-art analysis corrects Cognee provenance, temporal, tenant, graph, and document capabilities without adopting it as a dependency. |
Expand Down Expand Up @@ -57,7 +59,7 @@
| .planning/audits/2026-07-14-phase4-budget-delta/production-release-verification.md | CURRENT | 2026-07-14 | This is a stable historical verification record for the released v4.5.0 version, documenting immutable facts like commit hashes and CI status. |
| docs/handbook.md | CURRENT | 2026-07-14 | Strong cross-references from root files and active maintenance indicators (v4.2 changelog, changelog mentions) confirm this is the canonical operational guide. |
| .planning/codebase/CONVENTIONS.md | CURRENT | 2026-06-09 | The document explicitly states it was regenerated on 2026-06-09 from the current tree (v3.28.0), making it a living reference for project standards. |
| docs/adr/0001-local-first-single-database.md | CURRENT | 2026-07-14 | The document records a stable architectural decision (Local-First SQLite) that was reaffirmed recently (2026-07-14) and defines the core persistence model for the project. |
| docs/adr/0001-local-first-single-database.md | CURRENT | 2026-08-30 | Governing data stays in one logical store; ADR-0016's disposable analytics sidecar is explicitly excluded from recall and correctness paths. |
| docs/archive/security-audit/threat-model.md | CURRENT | 2026-06-20 | The file is a specific, dated security audit report and threat model that remains an accurate snapshot of the system's architecture and potential vulnerabilities as of the last commit. |
| docs/atlas-inbox-v1-technical-spec.md | CURRENT | 2026-05-07 | The document serves as the authoritative implementation plan for the V1 Atlas Inbox feature, mapping PRD requirements to existing MemoryMaster primitives and defining the data model for WhatsApp ingestion and action proposals. |
| docs/cross-project-patterns.md | CURRENT | 2026-07-14 | The document is behavior-derived, cites specific implementation lines and lifecycle rules, and describes R1.3 features like Qdrant quarantine and scope allowlists that appear to be the active architecture. |
Expand All @@ -78,7 +80,7 @@
| docs/archive/security-audit-2026-05-11.md | CURRENT | 2026-06-20 | The content is a dated but highly specific and technical security audit report that remains accurate as a historical record and reference for vulnerabilities unless explicitly fixed. |
| .planning/REMEDIATION-EXECUTION-V3-BUDGET.md | CURRENT | 2026-07-14 | The document contains a completed execution record from 2026-07-12, finalizing Phase 1 and explicitly stopping; it serves as the controlling authority for the V3 budget mode and audit delta. |
| .planning/codebase/INTEGRATIONS.md | CURRENT | 2026-06-09 | The document was regenerated recently (2026-06-09) from the current tree (v3.28.0), accurately reflecting the existing architecture, file paths, and integration logic. |
| docs/adr/README.md | CURRENT | 2026-05-12 | This index is the canonical navigation hub for 14 numbered architectural decision records and dated notes, and is actively referenced by the project root. |
| docs/adr/README.md | CURRENT | 2026-08-30 | Canonical navigation for 16 numbered decisions, including the disposable workflow-sidecar boundary. |
| docs/adr/0012-readme-stays-concise-handbook-holds-operator-depth.md | CURRENT | 2026-05-11 | This is an accepted architectural decision record (ADR) establishing a permanent documentation split strategy that remains relevant for project organization. |
| .planning/P2-CENSUS.md | CURRENT | 2026-06-15 | Recent (June 2026) snapshot census with actionable verdicts and specific code insights for the P2 restructure. |
| docs/adr/0006-sensitivity-filter-boundary.md | CURRENT | 2026-05-11 | The document establishes a stable architectural boundary between raw source storage and sanitized claims storage that remains applicable to the project's design. |
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- doc-head: MemoryMaster 4.8 governed memory, observations, profiles, and operations -->
<!-- Covers: installation, governed capture and recall, graph observations, compiled profile, scheduling, and safety. -->
<!-- Key terms: claims, citations, steward, graph observations, compiled profile, Gemini, Antigravity CLI, SQLite, MCP. -->
<!-- doc-head: MemoryMaster 4.8 governed memory, observations, profiles, workflow analytics, and operations -->
<!-- Covers: installation, governed recall, graph observations, compiled profile, Workflow Intelligence, scheduling, and safety. -->
<!-- Key terms: claims, citations, graph observations, workflow sidecar, compiled profile, Gemini, SQLite, MCP. -->
<!-- Read when: evaluating, installing, operating, or upgrading MemoryMaster. -->
<!-- Default: private local SQLite; observations and generated views never bypass claim governance. -->
<!-- /doc-head -->
Expand Down Expand Up @@ -39,6 +39,7 @@ evidence -> candidate claim -> steward -> confirmed claim -> governed recall
| Governed skills | Stores reviewed reusable procedures separately from ordinary facts | Recall opt-in |
| Hermes integration | Provides exact session/project scoping, local HTTP/stdio compatibility and replay-safe outbox behavior | Optional integration |
| Operational review | Performs a read-only six-hour integrity, queue, profile, intake and retrieval review | Optional Windows task |
| Workflow Intelligence | Mines Claude/Codex trajectories into local redacted analytics and inert improvement candidates | On demand; separate sidecar, no automatic promotion |

MemoryMaster 4.8 uses the configured **Gemini extraction + Gemini consolidation**
path for this installation; consolidation moved off GLM on 2026-08-20 when that
Expand Down Expand Up @@ -111,6 +112,24 @@ queued = improve(scope="project:atlas")

See [Public v1](docs/public-v1.md) for receipts and full parameter contracts.

## Workflow Intelligence

The optional `workflow` command family audits retained Claude Code, Codex, and
Wezbridge trajectories in a rebuildable local sidecar. It does not write claims,
modify agent instructions, or treat an LLM judgment as proof of success.

```powershell
memorymaster workflow scan --deep human
memorymaster workflow report
memorymaster workflow candidates
```

LLM classification is a separate opt-in command. The provider-neutral
completion receipt hook ships unregistered and defaults to `off`; advisory mode
cannot be configured until its 14-day shadow evidence gate passes. See
[Workflow Intelligence](docs/workflow-intelligence.md) for the schema, commands,
redaction boundary, recurrence rules, and rollout gate.

## Graph observations (PPR-7)

> **Off by default.** Enable with `MEMORYMASTER_GRAPH_OBSERVATIONS=1`.
Expand Down Expand Up @@ -216,8 +235,10 @@ producer
-> optional observations / skills / compiled profile
```

The default product is one private local SQLite database in WAL mode plus a
stdio MCP server. No new database, cloud service or vector server is required.
The authoritative product is one private local SQLite database in WAL mode plus
a stdio MCP server. Optional Workflow Intelligence uses a disposable analytics
sidecar that cannot participate in recall or lifecycle authority. No cloud
service or vector server is required.
PostgreSQL team operation remains explicitly deferred; Qdrant remains an
optional semantic accelerator rather than a source of truth.

Expand Down
19 changes: 16 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- doc-head: sole roadmap; PPR-7 integrated, compiled profile in development -->
<!-- doc-head: sole roadmap; Workflow Intelligence implemented locally and held off -->
# MemoryMaster roadmap
# Covers: post-v4.6 sequence, governed observations, compiled profile, and deferrals.
# Key terms: Hermes, governed skills, graph observations, user profile, sustainability.
# Covers: post-v4.6 sequence, workflow analytics, governed observations, compiled profile, and deferrals.
# Key terms: Workflow Intelligence, governed skills, graph observations, user profile, sustainability.
# Read when: choosing release scope, accepting a feature, or checking deferrals.
# Authority: sole roadmap; planning ledgers implement it and never replace it.
# Safety: SQLite remains authority; generated user.md is disposable and feature-off by default.
Expand Down Expand Up @@ -73,6 +73,12 @@ its governed-claims authority:
loops, hardening live extraction, and closing the first-soak gaps. Activation
is a separate operator decision that has not been made, so no rollout date
belongs here.
- Workflow Intelligence v1 is implemented on an isolated feature branch: local
Claude/Codex/Wezbridge census, deterministic trajectory analysis, bounded
opt-in classification, local reports, inert candidates, independent-session
rule governance, and an off-by-default receipt hook. Implementation and tests
do not authorize installing the hook, starting its 14-day shadow window,
releasing 4.9.0, deploying, or promoting any candidate.
- PPR-7 governed graph observations are implemented and locally verified on an
isolated feature branch. Implementation is additive, candidate-first, and
opt-in; its separate PR/CI, feature-off deployment, and rollout evidence are
Expand All @@ -91,6 +97,13 @@ its governed-claims authority:

## Next

- Review and integrate Workflow Intelligence without activating it. After a
separately approved shadow installation, collect at least 14 days and 100
eligible receipts (20 per Claude and Codex), manually review warnings, require
at least 90% precision and zero read-only false positives, then request a
separate advisory-mode decision. Never auto-promote analytics into rules or
skills.

- Complete the bounded session-scope, native Hermes MemoryProvider, and
governed-skill proposal program defined by
`.planning/HERMES-SCOPE-SKILLS-INTEGRATION-2026-08-07.md`; Windows SQLite
Expand Down
66 changes: 66 additions & 0 deletions benchmarks/bench_transcript_confidence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""Micro-benchmark del costo por llamada de `_transcript_confidence`.

Aisla el mecanismo que rompio el SLO de `cycle_p95` en el PR #248: la funcion
se llama DENTRO de un bucle de minado y, desde que el registro de linaje se
puso antes del gate de bootstrap, abre y cierra una conexion SQLite en cada
iteracion. Antes del cambio, con bootstrap deshabilitado —el default— la
funcion retornaba sin tocar la base.

Mide el camino real, no un proxy: mismo servicio, misma base en disco, mismas
kwargs de linaje. Correr antes y despues del arreglo.

Uso: python benchmarks/bench_transcript_confidence.py [--calls 200]
"""
from __future__ import annotations

import argparse
import sys
import tempfile
import time
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from memorymaster.core.service import MemoryService # noqa: E402
from memorymaster.knowledge import rule_miner # noqa: E402

LINAJE = dict(
scope="project:bench",
provider="google",
source_ref="transcript:bench",
evidence_hash="e" * 64,
session_kind="human",
)


def main(argv: list[str]) -> int:
ap = argparse.ArgumentParser()
ap.add_argument("--calls", type=int, default=200)
args = ap.parse_args(argv[1:])

tmp = Path(tempfile.mkdtemp())
svc = MemoryService(tmp / "bench.db", workspace_root=tmp)
svc.init_db()
rule = {"trigger": "cuando falle el deploy", "action": "revisar el log"}

# calentar: la primera llamada paga imports y creacion de tabla
rule_miner._transcript_confidence(svc, rule, root_session_id="warm", **LINAJE)

inicio = time.perf_counter()
for n in range(args.calls):
# raiz distinta por llamada: el caso real de un lote de correcciones,
# y evita que el dedup por (provider, root) haga el trabajo trivial
rule_miner._transcript_confidence(
svc, rule, root_session_id=f"root-{n}", **LINAJE
)
total = time.perf_counter() - inicio

print(f"llamadas : {args.calls}")
print(f"total : {total:.3f}s")
print(f"por llamada : {total / args.calls * 1000:.3f} ms")
print(f"llamadas/seg : {args.calls / total:.1f}")
return 0


if __name__ == "__main__":
sys.exit(main(sys.argv))
12 changes: 12 additions & 0 deletions docs/adr/0001-local-first-single-database.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<!-- doc-head: authoritative MemoryMaster data remains one local-first database -->
# 0001 Local-First Single Database
# Covers: the authority boundary for claims, evidence, lifecycle, and recall data.
# Key terms: SQLite WAL, authoritative store, Postgres parity, Qdrant.
# Read when: changing governed persistence or interpreting ADR-0016's analytics sidecar.
# Decision: all correctness-critical MemoryMaster tables share one logical store.
<!-- /doc-head -->

Date: 2026-05-05; reaffirmed 2026-07-14

Expand Down Expand Up @@ -40,3 +46,9 @@ disabled and documented, but do not block an accurately scoped local release.
Consumers must not create a split layout such as one database for claims and another for Atlas Inbox. A split layout creates disconnected state and silently breaks the claim/source relationship.

Schema and concurrency changes must preserve WAL behavior and the all-tables-in-one-store assumption.

ADR-0016 does not weaken this rule. It permits one disposable operational
sidecar for rebuildable coding-agent trajectory analytics. That sidecar cannot
participate in claims, recall, lifecycle, or cross-database correctness paths;
the minimal hashed recurrence lineage that affects skill governance remains in
the authoritative database.
Loading
Loading