Skip to content

feat: Galaxy v6 physics engine, graph scene overhaul, and ledger UI improvements - #138

Open
Coding-Dev-Tools wants to merge 207 commits into
mainfrom
feat/galaxy-v6-graph-scene-ledger-overhaul
Open

feat: Galaxy v6 physics engine, graph scene overhaul, and ledger UI improvements#138
Coding-Dev-Tools wants to merge 207 commits into
mainfrom
feat/galaxy-v6-graph-scene-ledger-overhaul

Conversation

@Coding-Dev-Tools

@Coding-Dev-Tools Coding-Dev-Tools commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Galaxy v6 physics, graph-scene projection, and Ledger dashboard overhaul. The PR contains 58 changed files (+17,766 / -1,342) on one branch targeting main.

What changed

  • Added hierarchical Galaxy systems, leapfrog integration, black-hole and far-field gravity, evidence-mass sizing, deterministic orbit seeding, bounded drag/reheat behavior, and expanded Gravity/Link/Orbital controls. Gravity now spans 0..400; the live solver uses a 0.032 fixed timestep, physical stellar-surface pressure, and bounded 18-unit global orbit seeding, while oversized static scenes map the full slider range.
  • Keeps complete Galaxy overviews physically live through 1,000 nodes / 2,000 relations, with deterministic fallback above that contract. Reduced visual-motion mode suppresses cosmetic/camera motion while preserving identical bounded physical dynamics.
  • Reworked graph-scene projection, canonical visibility, historical ghost nodes and edges, code overlays, repository-aware filtering and caching, privacy boundaries, and bounded node/edge selection.
  • Improved Ledger graph loading, saved filters, post-frame labels, accessibility, asset versioning, graph controls, responsive behavior, and historical evidence drilldowns for ghost relations whose endpoints remain live.
  • Hardened store migrations, transaction locking, workspace ownership races, named in-memory SQLite URIs, source/import handling, secure erasure, API validation, and repository-scoped historical evidence.
  • Added and synchronized unit, contract, migration, security, graph-engine, dashboard, and browser coverage plus changelog and skill/reference updates.

Review hardening

  • Normalized SQLite logical-digest header offsets and preserved historical edge capacity/metadata.
  • Rechecked personal-workspace ownership after concurrent creation and scoped historical support to the selected repository.
  • Atomically rescanned secure-erase successors, removed per-job import artifacts, rebuilt shared provenance, and retained tombstone compatibility.
  • Restored node labels through the post-frame graph-state pass and kept gravity endpoints, acceleration guards, reduced-motion parity, stellar boundaries, and oversized-scene compactness deterministic across the full 0..400 range.

Validation — final head 805cd72

  • ruff check . — passed
  • pyright — passed
  • python scripts/externalize_dashboard_assets.py — passed
  • python scripts/check_commercial_manifest.py — passed
  • python -m pytest -o addopts="" tests -q -rs — 4,026 passed, 35 platform/optional-extra skips, 1 expected duplicate-ZIP warning from the malformed-container security test
  • npx playwright test --reporter=list — 63 passed
  • GitHub PR checks — 23/23 passing
  • Review threads — 0 unresolved

…mprovements

- Galaxy physics: orbital mechanics, leapfrog integration, black hole gravity,
  solar system hierarchy, evidence-mass sizing, drag velocity preservation
- Graph scene: ghost edge sort fix, connected_only+include_history interaction,
  set-wise visibility refactor, code overlay fallback correction
- Ledger UI: graph load caching fix, repo filter in cache key, accessibility
  improvements, Galaxy controls integration
- Store: schema migration, logical digest header zeroing fix, verification
  scope correction, context_savings workspace coercion
- Service: entity visibility filter, workspace N+1 query fix, history mode
  ghost flags, migration locking
- API: graph scene fallback narrowing, whitespace workspace validation
- E2E tests: Galaxy slider/half-step/orbital separation coverage
- Unit tests: graph engine assets, explorer v2, scene contracts, benchmarks
- Scripts: dashboard readiness probe, port conflict differentiation
- Docs: changelog, MCP tools reference, skill package update

Co-authored-by: review agents (16 parallel reviewers, 4 fix agents)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f3b1f4993

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/store.py Outdated
Comment thread engraphis/core/graph_scene.py Outdated
- Restore schema cookie (offset 40) normalization in _logical_digest:
  SQLite backup can reset this field, causing digest mismatch and
  aborting all v3-v16 migrations. Codex P1.
- Reserve edge capacity for historical ghost relations: when
  include_history=True, ghost edges covering historical nodes are
  selected first before applying the final edge_cap, preventing the
  time-travel view from losing all historical edges. Codex P2.
- Update test_store_class_integrity to validate the corrected digest
  offsets (24, 40, 92).
- Replace U+2014 em dash with double hyphen in CHANGELOG.md line 73
- Fixes test_public_facing_docs_do_not_use_em_dashes assertion

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3e2fb6890

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/service.py Outdated
Prevents unbounded URL growth on persistent asset load failures.
The retry counter appends to asset URLs as a cache-buster; without a
cap, repeated failures produce increasingly long URLs and complicate
debugging. Ten retries provides ample recovery attempts before giving
up gracefully.
static/index.html (Ledger primary) incorrectly marked the Classic link
as active with aria-current=page. Swap so Ledger shows as the active
choice on the primary dashboard, matching the classic_assets variant
which correctly marks Classic as active. Prevents a brief flash of
incorrect state before JS init and fixes the HTML-only fallback.\n\nFrom Review13 medium finding.
- ledger.js: reject scene payloads carrying an error field before the
  object-fallback, preventing error response objects from being treated
  as graph data and causing downstream undefined property access.
- dashboard_assets/index.html: add aria-labelledby to graph tuning
  range inputs referencing their label spans so screen readers announce
  dynamic label text changes in Galaxy mode.

From Review08 low findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5dbcdbfcf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/engine.py Outdated
Comment thread engraphis/core/graph_scene.py
5 fixes for issues flagged by the Codex reviewer:

- P1 service.py: historical supports query now filters by
  memory.workspace_id so a cross-workspace support cannot leak into
  the include_history scene.
- P2 service.py: evidence facets (memory_types, time_from, time_to) are
  applied in history mode instead of being skipped by the live-only
  evidence_filter short-circuit.
- P2 service.py: entity candidate cap applies after session-scope
  pruning so private evidence cannot crowd out public entities.
- P1 engine.py: secure_erase re-checks successors after the potentially
  long index.delete and cleans up any new target IDs before calling
  store.secure_erase_memory.
- P2 graph_scene.py: ghost canonical nodes that collide with a live
  canonical_id are keyed as :ghost so the live node keeps its mass,
  community, and relations.

Co-authored-by: Codex review bot (addressed findings from d5dbcdb)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

engraphis/engraphis/service.py

Lines 7817 to 7819 in 3160ada

"AND (graph_support.valid_to IS NULL OR ?<graph_support.valid_to "
"OR (graph_support.valid_to_recorded_at IS NOT NULL "
"AND ?<graph_support.valid_to_recorded_at)) "

P2 Badge Use historical validity when filtering ghost evidence

When include_history=true is combined with memory_types, time_from, or time_to, a support for a genuinely historical edge has valid_to <= t, so this newly added live-validity predicate rejects it and the ghost relation disappears. Fresh evidence beyond the prior facet comment is that the replacement branch still requires supports to be live at the selected world-time; apply the history-mode validity predicate here instead.

AGENTS.md reference: AGENTS.md:L162-L164

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/graph_scene.py
Move prune_entities assignment before its first reference in the
evidence_filter computation. Ruff F821 caught the UnboundLocalError
that broke all graph scene operations across every Python version.
@Coding-Dev-Tools
Coding-Dev-Tools force-pushed the feat/galaxy-v6-graph-scene-ledger-overhaul branch from 9555936 to 0b2f070 Compare August 10, 2026 20:02
The previous commit introduced a dependency on prune_entities in the
evidence_filter assignment that broke live-only evidence filtering
when memory_types/time facets were requested without include_history.
Restore the original 'not include_history' logic; the prune_entities
override for history mode is handled separately below.

Fixes test_graph_scene_filters_supporting_memory_type_and_time_window.
Move the entity visibility check from a per-chunk correlated SQL query
to a single upfront workspace-wide edge visibility scan. Entity rows
are then filtered in Python using set membership, avoiding the extra
SQL query that broke test_graph_scene_entity_visibility_single_query.

This ensures private entities cannot consume the candidate budget
when a workspace has more than 3*MAX_GRAPH_ANALYSIS_ENTITIES rows.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46a1d3c220

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/service.py
savingsQuery() returned empty string for the 'all' preset, producing
URLs like /context-savings? with a dangling query separator. Move the
? prefix into the returned string so the 'all' case produces a clean
/context-savings path with no query component.

Fixes one of the remaining low-severity review findings.
The 'Ledger deadline includes stalled graph assets' E2E test was flaky
on CI runners under load. The 5s default Playwright timeout for the
reload+render cycle was too tight. Increase to 15s to match other
graph-dependent assertions in the suite.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad1a5498e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/service.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5524fbd798

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/graph_scene.py
…ions for connection

6a112d4 correctly preserves SQLite URI options (mode=ro/rw, immutable)
for the connection, but left self.path as the raw file: URI string.
test_memory_service_create_normalizes_file_uri expected store.path to
be a plain filesystem path.

Normalize self.path through _physical_sqlite_path when the input is a
file: URI, so store.path is always a filesystem path. The connection
still receives the original path parameter with all URI options intact.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da9ed45c60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/device_connect.py Outdated
Comment thread engraphis/config.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

rows = conn.execute(
"SELECT id, metadata, provenance FROM memories"
).fetchall()

P1 Badge Scope successor erasure to the primary workspace

When an untrusted synced row in workspace A sets provenance.conflict_of or metadata.sync_conflict.memory_id to a memory ID in workspace B, this global scan makes that row a recursive erase target. MemoryService.secure_erase() authorizes only the requested primary via _check_owns, so a B-bound caller can irreversibly delete A's memory and vector while erasing its own record. Restrict successor discovery to the primary memory's authoritative workspace/repository and validate the conflict lineage before deletion.

AGENTS.md reference: AGENTS.md:L165-L166

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aba73b10b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/dashboard_assets/ledger.js Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

counter_bucket = estimate_bucket(
estimate_totals["_counters"], counter, confidence
)

P2 Badge Report mixed confidence within counter buckets

When eligible receipts using the same token counter have different confidence levels—such as an adaptive_context history-retrieval receipt (high) and a packed recall receipt (medium)—the counter bucket is keyed only by the counter and retains whichever confidence was seen first. Its totals therefore combine both classes while by_token_counter[].confidence incorrectly reports a single confidence; track mixed confidence in these buckets rather than preserving the first receipt's value.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/config.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf69e7123b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/store.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f4fe55131

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/service.py
source_item["last_error"], target_item["id"],
),
)
c.execute("DELETE FROM source_imports WHERE id=?", (source_item["id"],))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate the losing memory when collapsing source items

When both workspaces imported the same vault and path, this deletes one manifest item but never closes whichever imported memory loses the last_seen_at selection. After the merge, both memories remain live; subsequent imports update only the manifest-selected lineage, so recall continues returning the orphaned duplicate indefinitely. Preserve its history by invalidating the losing memory when the manifest rows are collapsed.

AGENTS.md reference: AGENTS.md:L162-L164

Useful? React with 👍 / 👎.

Comment thread engraphis/service.py
Comment on lines +5497 to +5501
if target_item is None:
c.execute(
"UPDATE source_imports SET vault_id=?, source_key=? WHERE id=?",
(target_vault_id, destination_source_key, source_item["id"]),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rewrite memory provenance when reparenting source items

When colliding vaults contain disjoint paths, this branch moves the source item to the surviving vault and immediately continues without calling _rewrite_import_memory_source(). The losing vault is then deleted, while the imported memory's document/obsidian metadata still names that nonexistent vault, leaving exported provenance and Inspector lineage inconsistent with the durable manifest. Rewrite the memory envelope to the destination vault before continuing.

AGENTS.md reference: AGENTS.md:L215-L219

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74d0995ff2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/core/graph_scene.py Outdated
"tier": "evidence",
"visible_by_default": True,
"connector_kind": "evidence",
"ghost": ghost,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark closed evidence connectors as ghosts

When a relation remains live because it has another current support, a historical support whose own valid_to has passed inherits ghost=False from the parent edge here. The complete history scene then renders the connector from an invalidated ghost memory with nonzero strength and spring physics, allowing historical evidence to influence the live layout. Derive the connector's ghost state from the support and supporting memory validity as well as the parent edge.

AGENTS.md reference: AGENTS.md:L204-L206

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a478cdbc5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engraphis/service.py Outdated
support_conditions = (
"relation.workspace_id=? AND relation.{endpoint}=target.id "
"AND (relation.valid_from IS NULL OR relation.valid_from<=?) "
"AND relation.valid_to IS NOT NULL AND relation.valid_to<=? "

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include historical supports on still-live relations

When a relation remains live because it has another current support, but one of its supports has been closed, the history scene can expose that support as a ghost connector; however, this drilldown requires the parent relation itself to have a non-null valid_to. Opening Memories for that historical connection therefore returns no archived evidence. Base the history predicate on the support and supporting memory boundaries rather than requiring the parent relation to be invalidated.

AGENTS.md reference: AGENTS.md:L162-L164

Useful? React with 👍 / 👎.

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