Repository navigation
feat(memory): add compact Atomic Memory directory - #1767
wutongyuonce wants to merge 22 commits into
Conversation
Preserve pagination alongside upstream capacity and MCP additions. Keep revision-valid directory updates in the same commit transaction and verify pinned traversal across compaction. Regenerate the checked-in DSH bundle to satisfy the package freshness check.
|
@Teingi CI update: the previous 23 checks are now passing, including Python 3.11–3.14 and OceanBase acceptance. The only remaining failure is Acceptance (sqlite). Its uploaded exception evidence shows that the acceptance, LoCoMo, and fail-fast batches all stopped during agent dependency installation, before scenario execution: The download failed after three retries. This remaining failure is an external dependency-download error, not a pagination assertion failure; it does not establish a SQLite acceptance pass yet. Could a maintainer please rerun the failed SQLite acceptance job? My attempt to rerun it was rejected with HTTP 403 due to repository permissions. |
Preserve both the Memory directory cursor secret and the runtime model usage recorder in scoped service wiring.
|
Minimize additional tables and justify their responsibilities. |
|
Align schema changes and historical backfills with PR #1771.
|
|
@wutongyuonce Thanks for the implementation, tests, and scale validation in this PR. We are reviewing unified database migrations (#1771) and the Memory redesign (#1809, dependent on #1803). These designs would affect the directory projection, revision cursors, and migration approach used here. We therefore plan to close this PR for now and keep the pagination requirement in #1656 open until those designs are settled. We'd welcome your continued involvement, and the work you've done provides a useful reference for the next implementation. |
|
please update & resolve conflicts |
|
please update & resolve conflicts |
|
please update & resolve conflicts |
Upstream added released Artifact handles as `p0004`, so the directory work now appends `p0005` (frozen current SQLite business structure, including handles and bootstrap receipts) and `p0006` (directory metadata). The default migration target stays at the released `p0004`; only the optional `atomic-memory-directory` target adopts the later baseline. Conflict resolution kept both the directory read path (signed cursors) and the incoming BootstrapReceiptRepository in Runtime composition, and regenerated the OpenAPI-backed Python, Desktop and integration contracts plus the DSH bundle.
|
@Zxf-xufeng @PsiACE @hidb4ai Conflicts with Since your review this PR was refactored onto the existing Merge-head evidence: full pytest 5,380 passed / 429 skipped, directory+migration focused 253 passed, directory core 45 passed, DSH 329 passed, |
|
please update & resolve conflicts |
Integrate upstream 407f31c and regenerate Desktop contracts from the PR's OpenAPI source, preserving the Atomic Memory directory API and upstream drift checks.
The slim instance exhausted its 1 GB datafile while the snapshot regressions created indexes. Apply the clean-migration job's 4 GB initial and 8 GB maximum capacity, wait for effective parameters, and disable the test tenant recycle bin before running regressions.
|
@hidb4ai resolved |
|
@wutongyuonce Thank you for the substantial work on this PR, especially the compact directory contract, cursor validation, migration integration, and test coverage. We also recognize that the implementation has moved onto the unified migration process and no longer introduces separate pagination tables; the earlier concerns about a standalone migration authority do not describe the current implementation. With #1882 now merged, we would like to close this PR for now and revisit the directory capability when there is a concrete consumer and a clear backend support plan. The two features serve different purposes. #1882 provides relevance-based retrieval of Atomic Memory through the shared Artifact search contract. This PR provides a lightweight, filtered, paginated inventory of memory identities and lifecycle metadata. Search does not replace complete directory traversal, so the underlying directory requirement remains valid. However, the directory is not a prerequisite for the primary write → search → exact-read workflow that we want to prioritize now. Our reasons for deferring this implementation are:
If you would like to continue this work, a useful next step would be to define a small, end-to-end browsing use case, document why the existing list/search APIs cannot meet its bounds, and evaluate the implementation against the code now merged in #1882. Please reuse the existing query, filtering, authorization, and persistence boundaries where their contracts fit, and validate the combined implementation on the intended deployment backend. The directory's restart-on-mutation behavior should also be explicit to its consumer; it should not be presented as a snapshot-complete export during ongoing writes. We are closing this as a scope and prioritization decision, not because directory pagination has no value or because #1882 implements the same feature. The pagination requirement in #1656 remains a separate item to evaluate. You are very welcome to reopen this PR at any time to continue the discussion or bring back a focused implementation with a concrete consumer and backend plan. Thank you again for your contribution and for working through the reviews and updates. |
Which issue or RFC does this PR close?
Refs #1656. Follows the Atomic Memory/shared Artifact model in #1809/#1859 and the explicit migration boundary in #1771.
Rationale for this change
Browsing Atomic Memory identities should not load complete content or history. This adds a compact current-head directory with exact Artifact references. A content, lifecycle, merge/restoration or effective tag change invalidates continuation; callers restart from page one.
What changes are included in this PR?
POST /v1/atomic-memory/directory/query,query_atomic_memory_directoryin the HTTP SDK/MCP, and the Python scoped query. OpenAPI owns the generated contracts; Codex session Scope binding includes the operation. Regenerate Desktop wire/API contracts and the distributed DSH bundle; include the additive tool in Skill mock catalogs and negative controls.server db-migrateentry point and single revision table. Append frozen p0005/p0006 resources on top of the released p0004, current-head backfill/validation, shared batch commits and original-backup recovery. The default five-table acceptance target stays at the released p0004; released revision/env bytes are unchanged.Are there any user-facing changes?
The additive directory returns compact exact references with default limit 50 / maximum 100. Continuation must restart after changes. Full-record APIs retain their current contracts.
Production enablement in this PR is restricted to the registered default current SQLite business layout, ordinary persistent files, no embedding extension, and trusted-local or qualified same-database Builtin/Casbin Scope-read authorization. Stop all writers, run
server db-migrate plan/apply/verify --target atomic-memory-directory --env-file deployment.env, then restart the matching program. The target uses the database-adjacent default evidence directory. Migration does not invent owners.Unmanaged targets and unsupported access configurations fail explicitly. Unregistered historical/archive layouts, vector configurations and seekDB/OceanBase directory execution are not supported by this target. Existing initializers in other domains remain unchanged; this PR does not complete the entire migration RFC rollout. Shared migration output remains
readiness_scope=registered_bundle,server_ready=false. Restore under stopped writes and rotate the existing cursor signing secret before resuming.How was this change tested?
.venv/bin/python -m pytest -n 2 --doctest-modules tests -q: 5,380 passed, 429 skipped. Skips/deselections do not establish external backend, native-host or real-model acceptance.ty checkpassed.make docs-test: lint/test/static build passed, with 921 pages and internal links verified. sdist/wheel builds passed; packaged code and frozen resources were checked against the source.Final-head GitHub CI: 35 checks passed, 0 failed, 0 pending, including Python 3.11–3.14 unit/e2e, hosted quality, Skill guidance, ZCode, Windows Desktop, DSH, native services, documentation and existing backend acceptance/clean-migration checks. CLA status also passed. The separate optional Desktop
installed-packagejob was skipped and is not counted as passed; the Windows job built the installer and ran its installed-package smoke.Validation limit:
make check(release/manifest/guidance checks,uv lock --locked, all prek hooks,ty checkand the pydantic-aity check) passes on the merge head when uv resolves the repository's own index. The earlier local failure came from a local uv default index, which rewrote every lock URL; a mirror-based run is not a dependency change, and this contribution neither adds nor updates any dependency, manifest or lockfile. Directory and migration handling were renumbered after the merge: upstream owns the releasedp0004(stable Artifact handles), the frozen current business baseline isp0005(adding bootstrap receipts) and the directory expansion isp0006. Merge-head directory/migration focused tests: 253 passed, 114 skipped (opt-in real seekDB/OceanBase cases); directory core 45 passed; DSH plugin 329 passed; docs build 931 pages with internal links verified. Current head5e3aa659merges upstream0867144c. Existing backend regressions do not establish seekDB/OceanBase directory support. Maintainer review and design acceptance are still required.AI usage statement
OpenAI Codex assisted implementation, local source/contract review and validation. Local tests, real network/package evidence and unavailable external-backend checks are reported separately; no independent or hosted review pass is claimed.