Skip to content

feat(ui): port memory feature from OD PR #5228, fix fetchMemoryList() bug - #14

Merged
leonaburime-ucla merged 11 commits into
mainfrom
feature/jini-ui-memory
Jul 18, 2026
Merged

feat(ui): port memory feature from OD PR #5228, fix fetchMemoryList() bug#14
leonaburime-ucla merged 11 commits into
mainfrom
feature/jini-ui-memory

Conversation

@leonaburime-ucla

Copy link
Copy Markdown
Collaborator

Summary

Ports the memory feature (saved-memory list/editor, extraction-history stream, connector-sourced memory suggestions) into packages/ui/src/features/memory/, following docs/jini-port/god-components-extraction-plan.md's Consolidation map and the fixing-open-design-web skill's vertical-slice discipline.

  • Source: PR #5228, nexu-io/open-design, "refactor(web): decompose MemorySection into a features/memory vertical slice" — closed 2026-07-15 without merging. Pinned at commit d695f1e0f2b85a032aa7ce4895a3eb764cb1b65d (SHA verified via git fetch before any edit).
  • Why it never merged: extensive automated review found a long sequence of real async/state-correctness bugs, but the PR author independently confirmed via git show against the original 2,636-line monolith that every bug class already existed there — the decomposition exposed pre-existing, zero-coverage bugs, it didn't introduce them. The PR was closed because the review cycle felt endless, not because the approach was rejected (the maintainer's own last comment agrees the bugs were pre-existing).
  • The one bug still open when the PR closedfetchMemoryList() validated only that entries was present on a 2xx response, even though enabled/rootDir/index were all consumed elsewhere with no fallback. Fixed as part of this port (see dependencies.ts and the before/after in source-map.md), with a dedicated regression suite reproducing the exact malformed-response shape from the bug report.

What shipped

  • Full vertical slice: types.ts/constants.ts/rules.ts/ports.ts/dependencies.ts/formatters.ts/async-commit-guard.ts/index.ts at the feature's top level, react/{hooks,components}/ for everything importing React (this package's current layout convention).
  • 6 feature-local hooks (config, entries, extractions + its pure concurrency-ordering store, connectors, flash, navigation) and 8 dumb components, including MemoryHooksPanel folded in from a separate single-consumer OD file.
  • Every user-facing string wired through useT() per this package's i18n policy, with real I18nProvider-mounted translation-proof tests.
  • Connector-reconciliation reducers: rather than re-deriving PR #5228's own Memory-local duplicates, rules.ts imports the already-shipped, already-generified mergeConnectors/applyConnectorStatuses/hasConnectorStatusChanges from features/connectors (confirmed identical to OD main's connectors-state.ts, the actual origin of this piece — not PR #5228, whose own rules.ts comment calls its version "convenience duplication"). Full reasoning in source-map.md.
  • A scoped-down local render-markdown.tsx (micromark-based) replacing OD's out-of-scope 2,881-line runtime/markdown.tsx.
  • Real HTTP adapters (not a fake) for the plain /api/memory* REST surface — a deliberate, disclosed deviation from features/connectors' fake-only precedent, since this bug fix needed a real, testable adapter and the surface has no third-party vendor coupling to avoid. The connector-catalogue transport still fakes by default, matching features/connectors' own reasoning.

Validation

  • pnpm --filter @jini/ui typecheck: clean.
  • pnpm --filter @jini/ui exec vitest run src/features/memory: 423 tests, 21 files, all green.
  • Coverage: 100% on all 4 metrics (statements/branches/functions/lines), aggregate and every individual file — clears the ≥99%-with-100%-as-the-goal bar with zero /* v8 ignore */. The one genuine dead branch found (a try/finally whose bare catch could never itself throw) was refactored away, not suppressed.
  • Purity grep (Open Design/OD_/--od-stamp//tmp/open-design/@open-design//open-design.ai/openDesignDesktop, plus a stricter od-/composio pass): clean.
  • pnpm guard (repo root): green.
  • Monorepo pnpm -r --no-bail run typecheck: only pre-existing, unrelated failures already documented in source-map.md (stub packages missing tsconfig.json; daemon/deploy needing an unbuilt dist/) — @jini/ui and every other real package typecheck clean.

Full provenance note (source, what happened, the fix, the connector-reducer decision, what's intentionally not ported) is in packages/ui/source-map.md's new features/memory/ section.

Surface area

New package content only (packages/ui/src/features/memory/**, packages/ui/src/index.ts/index.test.ts registration, packages/ui/README.md, packages/ui/source-map.md). No existing files changed beyond registering the new feature in the package's top-level barrel + its completeness test.


Generated by Claude Code

claude added 11 commits July 18, 2026 04:37
Ports the ports/dependencies/rules/formatters/constants/types plus all
6 feature-local hooks from the pinned, never-merged OD PR #5228
(nexu-io/open-design, commit d695f1e0f2b85a032aa7ce4895a3eb764cb1b65d).

Applies the still-open fetchMemoryList() malformed-response fix, and
reuses @jini/ui's already-shipped features/connectors reconciliation
reducers instead of re-deriving Memory-local duplicates. Components +
tests + source-map provenance note land in follow-up commits.
Ports the 8 dumb components (MemoryHooksPanel folded in from OD's
components/MemoryHooksPanel.tsx, single consumer) and wires every
user-facing string through useT() per the i18n policy.

Applies the fetchMemoryList() fix: dependencies.ts now validates
entries/rootDir/index/enabled are present on a 2xx response (the four
per-hook flags keep their existing legacy-default fallback, matching
the code's own established intent). Typecheck and a purity grep both
pass clean.
Covers the fetchMemoryList() bug-fix regression suite explicitly
(entries/rootDir/index/enabled required, four per-hook flags
deliberately not required), plus the real HTTP adapters, the fake
connector catalogue, and the real browser pending-auth/notify bridges.
Documents PR #5228's source/SHA, the pre-existing-bug finding, the
fetchMemoryList() fix, the connector-reconciliation-reducer reuse
decision, the real-vs-fake transport split, and everything
intentionally not ported (host-owned orchestrator/subscriptions).
Adds useMemoryFlash/Navigation/Config, useMemoryEntries,
useMemoryExtractions hook tests and MemoryAdvancedModal/EntryCard/
ExtractionCard/HooksPanel/HowPanel/List/ManualEditor component tests,
each including a real I18nProvider-mounted translation-proof test.

Also fixes a systemic exactOptionalPropertyTypes gap in types.ts
(optional fields needed explicit , not just , to
accept the field-omitted-vs-explicitly-undefined test fixtures these
tests construct), and registers the feature in the package's top-level
barrel (src/index.ts) plus its completeness test.
…ryConnectedPanel, render-markdown)

All 412 tests green across 20 files; typecheck clean. Fixes two
exactOptionalPropertyTypes gaps found while wiring these in
(MemoryConnectedPanel's onOpenConnectors prop, and two test fixtures'
widened auth.kind literal types).
…emory

Adds the still-missing branches: requiredNonNullField's present-but-null
case, the fake connector port's no-accountLabel status derivation, a
blocked-sessionStorage write, the editor-focus/scroll effect (attaching
real DOM refs before triggering it, rather than treating it as
hook-level-untestable), and the suggestion-source toolTitle-only
fallback. Adds a features/memory own-barrel completeness smoke test.

Refactors useMemoryExtractions.hooks.ts's reloadExtractions() off a
try/finally (which carried a structurally-unreachable branch, since its
bare catch block never itself throws) onto explicit per-exit cleanup —
behavior-preserving, not a logic change.

Aggregate: 2616/2616 statements, 993/993 branches, 120/120 functions,
2616/2616 lines -- 100% on every metric, every file.
'@open-design/contracts' literal reworded to 'OD contracts-package',
matching the same convention already used elsewhere in this package.
…-map.md

423 tests/21 files green, 100% coverage on all 4 metrics aggregate and
per-file, monorepo typecheck confirmed regression-free against
pre-existing unrelated breakage, purity grep clean, pnpm guard green.
@leonaburime-ucla
leonaburime-ucla marked this pull request as ready for review July 18, 2026 15:21
@leonaburime-ucla
leonaburime-ucla merged commit 7b7f46f into main Jul 18, 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.

2 participants