Skip to content

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

Open
Hillary Mutisya (hillary-mutisya) wants to merge 3 commits into
mainfrom
dev/hillarym/wiki-review-workflow
Open

Hillary Mutisya (hillary-mutisya) wants to merge 3 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 passed again at current head 9c8e47d, against fetched 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

The policy bot's follow-up was fetched and fast-forwarded locally, then the full build, formatting and all four branch gates were rerun successfully.

GitHub Actions has not executed jobs for the current head: eight bot-triggered workflow runs report action_required. The build-ts run explicitly says it is awaiting approval from a maintainer. A maintainer must approve the workflows before current-head CI can be assessed; previous-head checks are not a substitute. Azure smoke tests are separately in progress.

The feedback inventory found no reviews, inline comments or unresolved threads. CI observation stopped at the verified manual-approval gate; no watcher remains active. This PR is not being reported CI-green or ready to merge.

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>

This branch has not been deployed

No deployments
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