Skip to content

fix(Alden): preserve activity cursors and verify memory history against source - #30

Closed
twoimo wants to merge 19 commits into
codex/alden-pipeline-readback-20261011from
codex/alden-activity-order-20261011
Closed

twoimo wants to merge 19 commits into
codex/alden-pipeline-readback-20261011from
codex/alden-activity-order-20261011

Conversation

@twoimo

@twoimo twoimo commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Alden's existing persisted collection journal could advance the viewer cursor while skipping invalid or out-of-order entries. History rows also conflated confirmed removals and relation changes with generic "stored" steps, and selected history events had no verification of current source/index status.

This stacked change preserves the existing project/target/cancellation boundaries and improves the actual runtime:

  • Validate each entire graph activity page before recording event IDs or advancing the durable cursor. Reversed sequence, malformed event, duplicated event ID, and sequence beyond the returned cursor cause bounded same-cursor retry without false 3D pulses.
  • Validate saved history pages in the correct direction (newest-first initial/older, oldest-first forward). A corrupt page preserves the visible history, counts, filters, and cursor; it never silently filters a bad row then commits a later page.
  • On actual revision storage, retain previous_version from that target's own membership. A same-name or same original from another target cannot impersonate the former version.
  • Display added/revised/unchanged/removed/relation-change states and exact removed/relation-change summary counts.
  • On user opening a stored/indexed memory history detail only, use existing read-only collection-trace with explicit allowed projects, document, version and target. Show confirmed original SHA-256, FTS and derived Dense binding only if document/version/target/projects and completed run_id match. Report retractions, later revisions and unavailable readback honestly; dispose/hide/filter/journal-reset fences suppress late replies. No reading creates collection events or AI-model-activity pulses.
  • Preserve visual palette/3D effects; use the existing evidence detail layout and no new background services.

Validation: macOS GitHub Actions 38070713835 exact CI SHA 6250f436ccaa7d41b0f1a1cebf269d0967e50266: 60/60 focused Python source/pipeline tests, 471/471 desktop UI tests, TypeScript/Vite production build. The 6 affected source/test blob SHAs were independently compared against this draft PR branch and all match. Early failed runs 38070024117 (test TTL fixture) and 38070472923 (TypeScript null narrowing) are retained; both were corrected and reevaluated.

Release gates: source-only + remote macOS CI, not the user's installed Alden. Source commit/branch is stacked on draft PR #29, then #28, then #27; no merges. No Mac Core turn_token or Desktop Computer Use connector is currently available, so the designated Mac clone, goal-objective.md/local outputs/STATUS.md, user DB/model/process/queue, physical STT/TTS and external osk-system host cannot be honestly claimed as verified. Current unsigned 0.3.58 artifact from commit c494a53 predates these changes.

Design, evidence and the pending Mac install/rollback steps: dated integration note.

Unsigned macOS candidate built from this change

GitHub Actions #38070940937 completed successfully: arm64 release bundle, source-bound allowlisted resource checks, archive SHA manifest and artifact upload. Build commit cf1f40779d9830dc14024cdf271ea9cdd30fe9b1 is the PR #30 head c62d6b7763a6644151aa18ff3a4edc7f239e3821 plus exactly one CI-only workflow file. Bundle version remains 0.3.58 and bundle ID com.openkakao.alden.desktop; bundled collection/retrieval/MCP/menu source Git blob SHAs match PR #30. GitHub Actions artifact: Alden-unsigned-macos-arm64-memory-continuity (artifact ID 11676592857). Inner app ZIP SHA-256 8daa4bccf9ec77297a5cb918371c0f9047fc7b8e12a3e2f03de8814f34057d17; verified 63 ZIP entries / 54 resource files / arm64 Mach-O. This is an unsigned, unnotarized, uninstalled build candidate, not a public release or owner's physical Mac runtime proof. The earlier candidate c494a53 is retained as dated prior evidence.

twoimo added 19 commits October 11, 2026 01:59
# A changed version in this *target's own* membership
# has a concrete before/after lineage. A different
# target's version must never be passed off as its past.
if category == "revised" and membership and membership[0] != version:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stops another target's version from being copied into previous_version, but the stored event still uses change=category, and category is still decided from the shared documents row (old is None / documents.current_version) just above.

Reproduced on this head c62d6b7763a6644151aa18ff3a4edc7f239e3821:

  • Target B's first ingest of the same original and the same text returns added=0, unchanged=1. activity_page for B is empty, because unchanged is not an activity kind, so the live graph consumer is not told about the new membership.
  • A further target's first ingest of different text returns revised=1. The stored detail is {change: "revised"} and has no previous_version.

test_revision_history_uses_previous_version_from_its_own_target_only passes and only checks that previous_version is absent. The new history labels then show those rows as "기존 자료 유지" and "기존 자료 수정".

Fix direction: classify added when this target has no membership. Keep previous_version only for a real change of that membership's version.

Regression that should exist: both first-time B cases above assert change=="added", added==1, no previous_version, and an activity item with kind=="added".

@twoimo

twoimo commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Closing: this is the Oct 10-11 side stack #28 to #32 (87 commits from 0509551, not in #48 by patch-id). It touches no src/ file and no auto-reply worker or supervisor. 31 of its 38 changed files do not exist on main (scripts/alden_voice.py, scripts/alden_tool_runtime.py, scripts/alden_collection.py, desktop/src/knowledge/* and their tests), so it cannot land on main without the lineage. The one change to a file main uses standalone is 72c7a3d in scripts/verify_local_models.py, a stricter operator-only probe that nothing on main calls. It stays on the branch.

Why the lineage cannot land as drafts. The codex/alden-* lineage forked from main at 533dbf6 (2026-10-05). Its tip is #48 (5f4843f), 727 commits ahead. main then took the 1.9.0/1.9.1 stability work (#49 to #58), and none of these drafts was rebased onto it.

  • A trial merge of main into the tip conflicts in 36 files, including 10k-line hunks in src/main.rs and src/context/mod.rs, which 1.9.0 split into modules.
  • A read-only audit found that the lineage's src/ax_send.rs lacks two 1.9.x composer safeguards: e14458e (an unreadable composer is not treated as empty) and 7d9635d (no second Return without a composer read, the double-send fix). A conflict resolved toward the lineage would compile and silently undo both.
  • The lineage's queue code bails on queue schema v3.
  • About 1.24M of the tip's 1.57M added lines are generated docs/architecture snapshots (about 121 MB).

What was kept. The audit read all 69 lineage commits that touch src/ or the auto-reply scripts. The three that fix main's production send path are now on main:

Every other lineage commit is on main already, superseded there, or Alden desktop and feature work that depends on lineage-only modules.

Nothing is deleted. The branch stays on the remote. The installed /Applications/Alden.app 0.3.219 was built from this lineage (a124320), so treat the branch as the source of that build. To bring the desktop work to main, start a planned integration from the tip, codex/alden-explicit-references-20261025, rebased onto main. Keep main's side in src/ax_send.rs and the queue v3 code. Reopen this PR or start from the branch if you want it.

@twoimo twoimo closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant