Skip to content

memory: add opt-in Wiki relationship and Inbox review workflow - #3292

Merged
Hillary Mutisya (hillary-mutisya) merged 4 commits into
mainfrom
dev/hillarym/wiki-review-workflow
Nov 19, 2026
Merged

Hillary Mutisya (hillary-mutisya) merged 4 commits into
mainfrom
dev/hillarym/wiki-review-workflow

Conversation

@hillary-mutisya

@hillary-mutisya Hillary Mutisya (hillary-mutisya) commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add an opt-in shared Wiki review workflow: four-way relationships, qualified partial-draft retention, one-shot Sol arbitration and durable Memory Hub Inbox review.
  • Preserve complete page/source evidence and revalidate citations, protected edits, revisions and current source authorization before automatic or human application.
  • Wire typed in-process, MCP, browser RPC and Inbox surfaces; keep native Decision1 replacement and experiment tooling out of this PR.

Motivation

Wiki candidates can be related without being duplicates, and useful draft material can be partially grounded without being safe to combine with or replace an existing article. Previously unresolved cases need a durable, evidence-bound review path rather than disappearing into construction failures or granting implicit merge authority.

This PR separates that shared workflow from changing the underlying decision model. It retains the existing configured Luna-backed decision path.

Behavior and configuration

  • Default off: opt in with FileMemoryServiceOptions.wikiReview: true or TYPEAGENT_MEMORY_WIKI_REVIEW=true through configured memory hosts.
  • Relationships: duplicate, related, distinct and uncertain. Topical/source overlap alone does not establish duplicate identity; identity alone does not establish coverage.
  • Partial retention: only eligible new drafts may retain qualified partial support. Policy scores are ordinal, not calibrated probabilities. Contradictions, known omissions and uncertain preservation do not authorize replacing an existing page or relaxing combination/publication gates.
  • Arbitration: explicit GPT_6_1_SOL, one durable logical reservation per frozen evidence/revision set, bounded recorded transport retries, no alternate-model fallback or recursive semantic repair. Interrupted or unsuccessful calls remain reviewable.
  • Inbox: inspect complete original evidence, pages, proposals and verification receipts; keep separate, approve a proposal after revalidation, or edit and revalidate complete resolution JSON. Stale, authorization and refresh errors remain explicit.
  • Disable/rollback: disable the option to stop new arbitration/application without deleting retained records. Existing review content remains readable under current authorization and applying controls become read-only.
  • Results remain drafts, not publication, human-reviewed trust or execution authority. No automatic article deletion or redirect.

Reviewer guide

  1. Shared contracts in wikiAdmission.ts, viewSupport.ts and wikiAmbiguity.ts; configured routing in viewSynthesis.ts.
  2. Durable reservation/application in viewStore.ts and final source-authorization checks in fileMemoryService.ts.
  3. Focused service tests for default-off compatibility, partial retention, strict preservation/publication, restart and asynchronous authorization changes.
  4. Client protocol, service RPC facade and MCP tool registration; browser control whitelist and request validation.
  5. Memory Hub Inbox rendering, quality labels and version-guarded actions. UI fixtures are synthetic, not live-model qualification.

Validation

Local validation on Windows with Node 26.13.0. Full build, pinned formatting and all four committed whole-branch gates pass at 6fae4bf, which merges fetched main e6e2d50.

The merge preserves main's final informational factual-field audit alongside opt-in choice-only quality. Partial drafts remain editable/readable only under normal evidence checks; partial quality cannot bypass factual auditing, publication or indexing gates.

Current follow-up validation:

Selection Result
CI reproductions: wikiAmbiguity, informationalRetrieval, sourceFollowing, evidenceWindow 4 suites / 65 tests passed
Factual proof, draft and publication boundaries: informationalSupport, viewDrafts, viewStoreReview, filesystemPublication 4 suites / 94 tests passed
Client test:local 89 tests passed
MCP: memoryMcpServer, viewInventoryProtocol, wikiAmbiguityProtocol 3 suites / 18 tests passed
Forced default-agent-provider compiler step and offline recipeModelProvider suite Compile passed; 29 tests passed

The final combined service run passed 16 suites / 356 tests on the pushed source, including the draft read/edit adjustment. It selects the eight service suites above plus wikiConsolidation, wikiContribution, informationalWiki, viewSupport, viewEditorialTemporal, viewSeparationService, wikiPlanningRecovery and schemaRequestAdmission. These counts overlap the smaller selections and must not be added together.

The browser renderer (531 tests) and Chromium fixture (2 tests) also passed after merging main, before the final backend/protocol-only fixes.

Historical pre-merge validation

Full build, formatting and committed gates previously passed at 9c8e47d, against main 4f2d364.

The broad tests below passed on the initial implementation 8e1367f. Follow-up 34cc3fd extracts the unchanged draft-quality copy expression into a helper to stay within the complexity budget and gives the browser fixture its own test command. After that refactor, the five affected save/partial/restart suites passed 101/101. The policy bot's 9c8e47d only alphabetizes that package script key; it changes no executable source or test content. No prior result is being presented as a fresh full rerun.

Check Command / evidence Result
Full build/type-check From ts: pnpm run build Passed
Memory service pnpm run jest-esm --runInBand --runTestsByPath selecting wikiAmbiguity, viewSupport, wikiDecision, wikiAdmission, wikiPlanningRecovery, viewHostOptions, wikiConsolidation, wikiContribution, wikiGrouping, viewEditorial, informationalWiki, viewSeparationService, filesystemPublication, wikiConsolidationRecovery, wikiConsolidationTemporal compiled specs 15 suites / 329 tests passed
Post-refactor service retest Compiled viewStore, viewStoreReview, viewDrafts, wikiAmbiguity, viewSupport specs, --runInBand --runTestsByPath 5 suites / 101 tests passed
Memory client From client package: pnpm run test:local 89 tests passed
MCP HTTP / RPC Compiled wikiAmbiguityProtocol, consolidationProtocol, capabilitiesProtocol, viewInventoryProtocol, editorialProtocol, viewBuildProtocol specs 6 suites / 13 tests passed
Browser renderer From browser package: pnpm run test:views:client 49 suites / 531 tests passed
Extension chromeRpcRouting, browserViewNavigation, index Jest suites 3 suites / 28 tests passed
Browser HTTP / IPC / startup node --test test/viewGateway.test.mjs test/viewDraftGateway.test.mjs test/viewLifecycle.test.mjs test/memoryHub.test.mjs 41 tests passed
Actual browser fixture From browser package: pnpm run test:views:wiki-review-browser 2 tests passed in headless Chromium
Formatting pnpm run prettier:changed Passed
Lint pnpm run code-lint -- --ratchet --base origin/main 281 → 281; passed
Complexity pnpm run code-complexity -- --ratchet --base origin/main --cyclomatic 25 --cognitive 30 --new-file-cyclomatic 25 --new-file-cognitive 30 No added over-budget functions; passed
Circular dependencies pnpm run code-circular -- --ratchet --base origin/main --exceptions-file tools/scripts/code/circular-baseline-exception.json 210 → 210; passed
Test debt pnpm run code-debt -- --gate --base origin/main No new skipped or focused tests; passed

UI verification: the real-browser fixture imports the production Inbox card renderer with synthetic evidence and checks complete evidence visibility, all three guarded actions, stale errors and refresh errors. The renderer suite separately mounts the Hub activity feed and verifies disabled read-only review behavior. Prerequisite: a compatible local Chromium (TYPEAGENT_BROWSER_EXECUTABLE) or Puppeteer's pinned Chrome (pnpm exec puppeteer browsers install chrome). No recording, real-user payload, live model call or latency measurement was used.

Risks, limitations and rollout

This is an opt-in initial release. Sol availability and model judgments remain operational/quality risks, so failed or unverifiable proposals stay visible and original pages are retained. The edit surface is structured JSON, not a visual merge editor.

Deterministic and browser verification do not establish live model accuracy, Sol cost or end-to-end readiness latency. This PR makes no performance claim, does not enable native Decision1 and does not qualify default enablement.

Current-head CI and review status

6fae4bf is pushed and GitHub reports the branch mergeable. It merges main and fixes the missing source-retirement protocol field, the advertised MCP tool inventory and the retrieval fixture's hash of a truncated source page. The fixture now reads all source-content pages rather than weakening source-hash validation.

The earlier workflow-approval gate was cleared and those runs exposed the now-reproduced regression failures. The original Azure Windows provider build diagnostic did not reproduce locally. Fresh Azure build 144591 now confirms the Windows full build and both platforms' smoke tests pass. No speculative API/export change was made.

Current-head CI is complete: 106 checks passed, 3 skipped, no failures or pending checks; all required checks passed. Skips are the two conditional macOS package-partition jobs and fork-only formatting.

Build-ts CI passed on attempt 2. One unchanged Windows Node 24 agent-session batching test initially observed two publications instead of one; its bounded admission window is 25 ms. All 15 tests in that suite passed locally, the Windows Node 26 shard passed, and one targeted retry of the affected Windows Node 24 shard passed. No assertion, timeout or production behavior was changed to obtain that result.

The paginated feedback inventory found no general comments, reviews, inline comments or review threads; no reviewers are currently requested. Monitoring has ended. Normal reviewer approval is still required; this PR has not been merged or automatically approved.

Keep related subjects independent, retain qualified new partial drafts, and reserve one evidence-bound Sol arbitration with durable Inbox review. Revalidate source access, citations, revisions and preservation before applying drafts; keep native model replacement separate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep draft-save complexity within the existing budget without changing quality semantics, and expose the focused Wiki browser fixture separately from unrelated browser qualification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve final factual audits alongside opt-in Wiki quality checks and keep partial drafts editable and readable without publication authority. Complete source-retirement protocol metadata, update MCP discovery coverage, and hash full paginated source content in retrieval fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hillary-mutisya
Hillary Mutisya (hillary-mutisya) merged commit d4309b2 into main Nov 19, 2026
188 of 197 checks passed
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