Skip to content

P1-X: Complete hierarchical/dialectical query pipeline — bug fixes + Williams-bound enforcement#77

Merged
devlux76 merged 5 commits intomainfrom
copilot/p1-x-ensure-hierarchical-query-pipeline
Mar 14, 2026
Merged

P1-X: Complete hierarchical/dialectical query pipeline — bug fixes + Williams-bound enforcement#77
devlux76 merged 5 commits intomainfrom
copilot/p1-x-ensure-hierarchical-query-pipeline

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

  • Fix storage/IndexedDbMetadataStore.ts syntax bug
  • Fix daydreamer/ClusterStability.ts
  • Fix daydreamer/FullNeighborRecalc.ts: MIN_RECALC_PAIR_BUDGET=2048 floor
  • Fix sharing/SubgraphExporter.ts
  • Fix test mocks
  • Fix daydreamer/PrototypeRecomputer.ts docstring and lint errors
  • P1-C: FastNeighborInsert — Williams-derived max degree always applied
  • P1-E: Query.tsgetAllPages() gated behind options.maxHops === undefined
  • P1-A: HierarchyBuilder quota enforcement — per-node threshold, deleteVolume(), proper variance, shelf in-place update
  • HotpathPolicy.ts Williams-bound utilities
  • Update DESIGN.md Motivation section with "The Geometric Root: Curse of Dimensionality" subsection (unit ball volume formula, exponential collapse explanation, geometric counter-measures)
  • Update DESIGN.md Williams Bound glossary entry to reference unit-ball collapse as the geometric driver
  • Update README.md Core Design Principles "Sublinear Growth" bullet to include unit-ball formula and full explanation tying geometric root to Williams fix
  • 416/416 tests pass, lint clean, typecheck clean
Original prompt

This section details on the original issue you should resolve

<issue_title>P1-X: Ensure P1 hierarchical/dialectical query pipeline meets DESIGN</issue_title>
<issue_description>This is a super-task for finishing the remaining P1 work that must be completed to satisfy the DESIGN’s hierarchical + dialectical retrieval contract.\n\nIt is a child of #68 (P1 tracker). Close the subtasks below as they complete — this issue stays open until every subtask is done.\n\n### Subtasks (close the relevant issue when done)\n- [ ] Ensure HierarchyBuilder enforces Williams/fanout quotas and triggers splits when quotas are exceeded. (Related: #23)\n- [ ] Ensure Ranking/Pipeline is wired into as a resident-first hierarchical cascade (shelf → volume → book → page) with warm spill. (Related: #24)\n- [ ] Ensure FastNeighborInsert uses cutoff derived from (Williams-bound logic) rather than hardcoded constants. (Related: #57)\n- [ ] Ensure Query orchestrator enforces a subgraph cost budget (max subgraph size / max hops) and uses Hebbian-weighted edge traversal + provenance metadata. (Related: #60)\n- [ ] Expand integration test coverage to validate hierarchical structure presence + dialectical query behavior (knowledge gap, coherence path, bounded expansion). (Related: #61)\n\n### Completion guidelines\n- Close each source issue (e.g., #23, #24, #57, #60, #61) as soon as the implementation satisfies its acceptance criteria.\n- This issue should remain open until all checkbox items are complete and the system matches the DESIGN described in the P1 issues.\n\n> NOTE: This is a tracking issue, not the implementation itself. Use it to coordinate completion across the individual subtasks.</issue_description>

<agent_instructions>In short, check each P1 subtask against DESIGN.md and the code base. Ensure the task isn't going to be a regression. Fix anything that needs fixed, ensure there are no bugs, everything lints, typechecks and compiles cleanly, and basically get P1 knocked out completely. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 14, 2026 02:02
…Volumes syntax, fix FullNeighborRecalc budget logic

Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
…, HierarchyBuilder quota enforcement, fix pre-existing lint errors

Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
Copilot AI changed the title [WIP] [P1-X] Ensure P1 hierarchical query pipeline meets design P1-X: Complete hierarchical/dialectical query pipeline — bug fixes + Williams-bound enforcement Mar 14, 2026
Copilot AI requested a review from devlux76 March 14, 2026 02:14
@github-actions github-actions Bot added layer: foundation Core types, model profiles, crypto layer: storage OPFS vector store and IndexedDB metadata store layer: hippocampus Ingest orchestration (chunk → embed → persist) layer: cortex Retrieval orchestration (rank → expand → order) layer: daydreamer Background consolidation (LTP/LTD, recalc) layer: testing Test coverage and integration tests labels Mar 14, 2026
@devlux76 devlux76 marked this pull request as ready for review March 14, 2026 02:16
Copilot AI review requested due to automatic review settings March 14, 2026 02:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the Metroid→Semantic neighbor API migration and extends Williams-bound policy usage across ingestion, query, and maintenance paths, while updating mocks/tests to match the evolving MetadataStore interface.

Changes:

  • Renames remaining test/mocks and sharing code to use SemanticNeighbor* APIs and *NeighborRecalc dirty flags.
  • Adds Williams-derived helpers to core/HotpathPolicy (computeNeighborMaxDegree, computeSubgraphBounds, computeFanoutLimit) and corresponding unit tests.
  • Integrates Williams-derived bounds into FastNeighborInsert, Query subgraph expansion, and adds hierarchy fanout enforcement logic.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/sharing/SubgraphExchange.test.ts Updates mock MetadataStore to semantic neighbor APIs + new required CRUD methods.
tests/integration/Daydreamer.test.ts Renames dirty-flag API usage to *NeighborRecalc.
tests/HotpathPolicy.test.ts Adds unit tests for new Williams-derived HotpathPolicy helpers.
tests/daydreamer/PrototypeRecomputer.test.ts Updates mocks/types to semantic neighbor APIs + new MetadataStore methods.
tests/daydreamer/HebbianUpdater.test.ts Updates mocks/types to semantic neighbor APIs + new MetadataStore methods.
tests/daydreamer/FullNeighborRecalc.test.ts Renames sync helpers + dirty-flag API usage to semantic neighbor naming.
tests/daydreamer/ClusterStability.test.ts Fixes duplicate import, updates semantic neighbor naming, and extends mock to new interface methods.
tests/benchmarks/HotpathScaling.bench.ts Extends benchmark MetadataStore stub with new interface methods.
storage/IndexedDbMetadataStore.ts Adds/repairs getAllVolumes() implementation (needed by new consumers).
sharing/SubgraphExporter.ts Switches exporter expansion to getSemanticNeighbors.
hippocampus/HierarchyBuilder.ts Adds Williams-derived fanout quota enforcement with split logic for oversized volumes/shelves.
hippocampus/FastNeighborInsert.ts Derives semantic neighbor max degree from Williams bound when policy is provided.
daydreamer/PrototypeRecomputer.ts Removes unused imports/variables; keeps centroid recompute while explicitly skipping non-page salience updates.
daydreamer/FullNeighborRecalc.ts Renames neighbor APIs and adjusts budget logic to always process at least one dirty volume.
daydreamer/ClusterStability.ts Renames label-propagation options and switches to semantic neighbor APIs; updates module header docs.
cortex/Query.ts Computes dynamic subgraph expansion bounds via computeSubgraphBounds.
core/HotpathPolicy.ts Introduces Williams-derived helper functions for degree, expansion bounds, and fanout limits.

Comment thread hippocampus/HierarchyBuilder.ts
Comment thread hippocampus/HierarchyBuilder.ts Outdated
Comment thread cortex/Query.ts Outdated
Comment on lines +127 to +129
const allPages = await metadataStore.getAllPages();
const subgraphBounds = computeSubgraphBounds(allPages.length);
const effectiveMaxHops = options.maxHops ?? subgraphBounds.maxHops;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot Ok resolve the issue using your best judgement, verify there are no negative downstream effects and update the DESIGN.md if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 901d002: getAllPages() is now gated behind if (options.maxHops === undefined) — when the caller provides an explicit maxHops, the full-page scan is skipped entirely. No downstream effects; the warm-spill path has its own independent getAllPages() call which remains unchanged.

Comment thread daydreamer/FullNeighborRecalc.ts Outdated
Comment thread hippocampus/FastNeighborInsert.ts
Comment thread daydreamer/PrototypeRecomputer.ts
…Recalc budget floor, FastNeighborInsert default degree, PrototypeRecomputer docstring

Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
…IGN.md and README.md

Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
@github-actions github-actions Bot added the layer: documentation API docs, developer guide, architecture diagrams label Mar 14, 2026
@devlux76 devlux76 merged commit dd8c430 into main Mar 14, 2026
3 checks passed
@devlux76 devlux76 deleted the copilot/p1-x-ensure-hierarchical-query-pipeline branch March 14, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

layer: cortex Retrieval orchestration (rank → expand → order) layer: daydreamer Background consolidation (LTP/LTD, recalc) layer: documentation API docs, developer guide, architecture diagrams layer: foundation Core types, model profiles, crypto layer: hippocampus Ingest orchestration (chunk → embed → persist) layer: storage OPFS vector store and IndexedDB metadata store layer: testing Test coverage and integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P1-X: Ensure P1 hierarchical/dialectical query pipeline meets DESIGN

3 participants