Skip to content

feat(journey): recover project and session journey workflow - #827

Draft
Harry19081 wants to merge 33 commits into
developfrom
dev/pr770-journey-recovery
Draft

feat(journey): recover project and session journey workflow#827
Harry19081 wants to merge 33 commits into
developfrom
dev/pr770-journey-recovery

Conversation

@Harry19081

@Harry19081 Harry19081 commented Aug 16, 2026

Copy link
Copy Markdown
Member

Problem

PR #770 contains a substantial contributor-built Journey feature, but repeated rebases and force-pushes left duplicated commit history and conflicts with current develop. Replaying the branch wholesale would also restore obsolete app-shell/history paths and unrelated provider, key-vault, search, release, and ProgressMindMap changes.

The missing product capability is one cross-layer workflow: a canonical Project → Session Journey, explicit task/fork/checkpoint/review lifecycle state, branch-scoped provider history, and exact navigation back to the durable transcript evidence.

Solution

Recovered the focused Journey workflow onto current develop using cherry-picks with source provenance, then adapted conflicts to the current architecture:

  • Projects contain canonical sessions directly; Work Items remain optional metadata and never own sessions.
  • Session Journey lifecycle mutations are revisioned/CAS-protected and persist exact durable message membership, branch, task, sequence, review provenance, and handoff capsules.
  • Provider history is filtered before reconstruction to the active fork plus exact ancestor prefixes; confirmed handoff capsules are appended without leaking sibling or parent-future transcript.
  • Project Tree, Journey graph/timeline, session controls, review dock/recovery, and task/fork/checkpoint routes are integrated into the current workstation tab architecture.
  • Exact durable message targets flow through tab reuse, pagination, scrolling, pinned headers, and highlighting.
  • Existing Agent Org inbox materialization, modular ChatHistory, sidebar status semantics, session header actions, and alternate session surfaces remain intact.
  • Review polling is single-flight and visibility-aware; Project Tree enrichment is concurrency-bounded and render-coalesced; stale async generations cannot overwrite a new session or unmounted surface.
  • Additive canonical fields use defaults so existing serialized sessions/edit artifacts remain readable. The only dependency change links the existing workspace-local orgtrack_graph crate into the desktop application; no third-party dependency was added.

Contributor commits whose changes were already represented were skipped instead of replayed as duplicate patches. Obsolete Journey Station routes and mixed-scope provider/key-vault/search/release changes were intentionally excluded.

Potential risks

  • This is a large cross-layer recovery (151 files) spanning SQLite persistence, Rust state machines/queueing, Tauri commands, canonical graph projection, React UI, and workstation navigation. The focused automated suites pass, but reviewer attention should remain on the persistence/wire boundaries and current-shell adaptations.
  • Rendered Tauri/WDIO coverage and screenshots were not produced. There is no deterministic Journey E2E seed/spec in the current harness, and desktop UI control was not authorized for this task. Keep this PR in Draft until the important visible states are exercised in the real app.
  • Real-process CPU/RSS, hidden-window idle behavior, and a high-session-count profile were not measured. Code-level lifecycle guards pass, but the performance verdict remains blocked for release measurement rather than claiming improvement from code shape.
  • The contributor's mixed provider-wide “uncapped review output” change was excluded. Journey review continues to use the existing 1,024-token side-query budget, which may truncate unusually large review annotations.
  • The Journey tables and metadata are additive. Rolling back the application code by reverting this PR leaves any created Journey rows inert rather than deleting user data; reapplying the feature restores access. Destructive schema rollback is neither required nor recommended.

Contributor credit

This feature was primarily contributed by @chsimonpan. Their original commit authorship and cherry-pick provenance are preserved throughout this PR; the recovery work resolves the rebased history and adapts the feature to current develop.

Verification

  • pnpm typecheck — passed.
  • ESLint over every changed src/**/*.ts and src/**/*.tsx with --max-warnings 0 — passed.
  • Focused Vitest command covering Tauri adapters, Project Tree/graph, Session Journey controls/snapshot, exact ChatHistory targets, renderers, routing, and tab mutation — 18 files / 81 tests passed.
  • cargo test -p agent_core journey --lib — 51 passed.
  • cargo test -p agent_core persistence::messages --lib — 15 passed.
  • cargo test -p orgtrack_graph journey — 7 passed.
  • cargo test -p orgtrack_core — 547 passed / 8 ignored local-data benchmarks.
  • cargo test -p org2 journey — 6 passed; targeted runtime artifact projection — 1 passed; targeted file-session-history fixtures — 4 passed.
  • cargo check -p org2 — passed.
  • cargo clippy --workspace --all-targets -- -D warnings — passed under Rust 1.97.0, matching the failed CI job's toolchain and exact command.
  • rustfmt --check over every Rust file changed by this branch with child traversal disabled — passed.
  • git diff --check and added-line scans for secrets, personal paths, debug logging, build artifacts, and caches — passed.

cargo fmt --all -- --check was also attempted. It still reports formatting drift in three files unchanged by this PR: render_inline_canvas.rs, ui_metadata_tests.rs, and turn_window.rs. Those baseline files were not reformatted into this feature PR.

Not run: rendered WDIO/Tauri E2E, visual screenshots/recordings, real-process performance measurements, and Windows/Linux platform checks.

Audits

  • Architecture: docs/architecture-audit-2026-08-17/SessionJourneyRecovery.md — pass for draft review across all ten layers.
  • UI consistency: docs/frontend-ui-audit-2026-08-17/ProjectTreeAndSessionJourney.md — 0 fix / 10 keep-with-reason / 0 abstract. The configured audit skill was unavailable, so the equivalent review is recorded manually.
  • Performance guard: docs/org2-performance-guard-2026-08-17/SessionJourneyRecovery.md — lifecycle invariants pass; release verdict remains blocked on real-process measurement.

chsimonpan and others added 30 commits August 16, 2026 22:52
Add Workspace→Project→WorkItem→Session/Todo tree and project journey
view with mainline pin, file category blink, and soft prune. Ship as
org2-patch parallel to production ORG2.

(cherry picked from commit 647d981)
(cherry picked from commit 7580fc904750090c463179e08dd3d16cd653d4b5)
Replace the P1 fail-closed stub with the real data path:
- read persisted canonical sessions/edit artifacts/commit links
- scope filter: project/{id} matches workspace_path; session/{id}
  selects the session plus its parent lineage chain
- project_canonical_journey projector + independent audit (fail closed
  on uncovered canonical units)
- fork edges only emitted when parent is inside the selected scope

(cherry picked from commit 755ae6d)
…t store

project/{id} now reads linked_repos_json from projects.db and selects
every canonical session whose workspace_path is inside one of the linked
workspaces (exact or direct child). Unknown project ids and projects
without linked workspaces stay fail-closed: no guessed paths, no
synthesized data.

(cherry picked from commit db1b6b3)
Journey-only extraction from mixed historical commits.

(cherry picked from commit eb31a18ed606d9b7e071944ab6a7d4262f3a3596)

(cherry picked from commit dbe58cb6cf6313a73f2c4bb23b814a8aa2c77ce)
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.

2 participants