Frontmatter
| title | feat(memory-core): weight frontier contexts by trust tier (#10292) |
| author | neo-gpt |
| state | Merged |
| createdAt | May 26, 2026, 1:18 AM |
| updatedAt | May 26, 2026, 1:43 AM |
| closedAt | May 26, 2026, 1:43 AM |
| mergedAt | May 26, 2026, 1:43 AM |
| branches | dev ← codex/10292-frontier-trust-weighting |
| url | https://github.com/neomjs/neo/pull/12002 |

PR Review Summary
Status: Approved
πͺ Strategic-Fit Decision
Per Β§9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: Clean parallel of the #11980 + #12000 trust-tier pattern, applied to the third remaining
#10292slice (frontier hydration ranking). Bounded scope (+148/-2, 2 files),Refs #10292(notResolves) explicitly preserves the openget_context_frontierfollow-up surface and forward-only migration docs. The trust-weight formula is bounded and linear; weighted score composes cleanly with the existing graph-topologyweight. CI all green at23084f467.
Peer-Review Opening: Nice closer on the third #10292 slice β projecting sourceTrustTier into the frontier hydration and ranking by weight Γ trustWeight is the substrate-correct shape for trust-aware semantic surfacing. Approving.
πΈοΈ Context & Graph Linking
- Target Epic / Issue ID: Refs #10292 (deliberately not
Resolvesβ durable forward-only migration docs + final rollout reconciliation remain per PR body) - Related Graph Nodes: #11979 (summary provenance stamping), #11980 (raw-memory trust filter), #12000 (query_summaries trust filter);
ai/graph/identityRoots.mjs(TRUST_TIERS+TRUST_TIER_ORDERsource of authority)
π¬ Depth Floor
Documented search: I actively looked for (1) trust-weight formula bounds β verified (maxRank - rank + 1) / (maxRank + 1) lies in (0, 1] for all 8 tiers (SYSTEM=1.0 β UNCLASSIFIED=0.125); (2) backward-compat β confirmed metadata field still preserved on each semanticContext, only additive new fields (trustTier, trustWeight, weightedScore); (3) sort-order side effects β grep across ai/ test/ for sibling assertions on semanticContexts ordering found none other than the new test; (4) OpenAPI claim β confirmed /context/frontier response declares schema: type: object (generic, no breaking change for additive fields); (5) parallel pattern consistency β resolveSummaryTrustTier mirrors SummaryService.resolveSummaryTrustTier byte-for-byte (intentional reuse across services for the summary-provenance contract). No concerns.
Rhetorical-Drift Audit:
- PR description: framing matches diff (narrow frontier-ranking slice; explicit
RefsnotResolves) - JSDoc additions: precise β
getFrontierTrustWeightdocuments the multiplier semantic +(0, 1]range;resolveSummaryTrustTierdocuments the SessionService stamping anchor - No
[RETROSPECTIVE]tag inflation - Linked anchors: PR body cites #12000 + #11979 + #11980 correctly; the parallel pattern is real
Findings: Pass.
π§ Graph Ingestion Notes
[RETROSPECTIVE]: Linear trust-weight decay(maxRank - rank + 1) / (maxRank + 1)is the calibration choice (not the only viable shape β exponential decay would penalize low-trust contexts more aggressively). The 8-tier ladder produces concrete multipliers:SYSTEM=1.0, REPO_TRUSTED=0.875, OWNER=0.75, SELF=0.625, PEER_TRUSTED=0.5, INTERNAL_AUTHORED=0.375, EXTERNAL=0.25, UNCLASSIFIED=0.125. Linear preserves the "still returned but ranked lower" intent. Worth re-visiting if/when post-deployment empirical evidence shows the multiplier shape mis-ranks contexts.
N/A Audits β π― π π‘ π
N/A across listed dimensions: no close-target magic keyword (Refs #10292, not Resolves); no Contract Ledger in the parent ticket (multi-slice epic; per-slice contracts inline in PR body); OpenAPI response is generic type: object so additive response-field projection requires no schema update; no skill / convention / startup-substrate changes.
πͺ Evidence Audit
- PR body contains an
Evidence:declaration line (L1 β L1 required) -
## Post-Merge Validationsection present with the remaining#10292follow-up surface noted - L1 evidence: 16/16 PASS focused MemoryService.TenantIsolation.spec.mjs is the right ceiling for service-method ranking behavior β pure-function deterministic; no harness / wake / restart / runtime-effect AC requiring L2+
Findings: Pass.
π Wire-Format Compatibility Audit
PR adds 3 fields per semanticContext in getContextFrontier's response:
trustTier: 'system' | ... | 'unclassified'trustWeight: Number (0, 1]weightedScore: Number
OpenAPI: get_context_frontier response is schema: type: object (generic). Additive fields are backward-compatible β existing clients ignore unknown keys.
Sort order change: semanticContexts is now sorted by (weightedScore DESC, weight DESC). Previously the array preserved the graph-topology iteration order. This IS a behavioral change visible to consumers β but no sibling test/spec asserts on the pre-fix order (grep across ai/ test/ confirmed), and the PR body documents the new ranking semantic in Deltas from ticket.
Findings: Pass β backward-compatible additive fields + behaviorally-aligned sort change.
π§ͺ Test-Execution & Location Audit
- PR body Test Evidence lists
MemoryService.TenantIsolation.spec.mjs β 16/16 passed - Canonical Location: new test in existing
test/playwright/unit/ai/services/memory-core/MemoryService.TenantIsolation.spec.mjs - CI verified green at
23084f467(lint-pr-body, CodeQL, Retired Primitives, unit, integration-unified all PASS) - Test fixture mocks
GraphService.getContextFrontier+StorageRouter.getSummaryCollectionat the right layer; the new test would FAIL pre-fix because the pre-fix code didn't computeweightedScoreand didn't sort by it - Spy fixture for Chroma collection mirrors the pattern established in #12000 (createSpyCollection + rows.set)
- Test assertions verify both the projection (3 new fields on each semanticContext) and the ranking (owner > external > legacy ordering)
Findings: Pass. Local re-run skipped β CI is green, test layer is at the right boundary, fixture pattern is the established one.
π Required Actions
No required actions β eligible for human merge.
π Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - Direct parallel of #11980 + #12000 trust-tier patterns.resolveSummaryTrustTierreuses the same semantic; newgetFrontierTrustWeightis a clean composition. Trust-multiplier composes cleanly with the existing graph-topologyweight.[CONTENT_COMPLETENESS]: 90 - PR body has Deltas, Test Evidence, Post-Merge Validation. 10 points off for the FAIR-band line saying[16/30 β current author count over last 30 merged]β the format is non-standard (most authors quote band classification + count). Minor.[EXECUTION_QUALITY]: 95 - Formula bounds verified; sort tiebreaker is the existingweight(sensible); JSDoc explains both projection and weight semantics; test covers projection + ranking.[PRODUCTIVITY]: 90 - Closes one more AC surface of #10292 cleanly; explicitRefsnotResolveskeeps the ticket open for migration-docs follow-up.[IMPACT]: 75 - Frontier ranking is the highest-visibility consumer surface of the trust-tier substrate; trust-aware semantic surfacing is the substrate goal #10292 was opened for. One more slice after this closes the ticket.[COMPLEXITY]: 35 - Low: two files, additive change with a small new helper and a sort.[EFFORT_PROFILE]: Quick Win - Bounded slice leveraging the established #11980/#12000 pattern.
Approving β eligible for operator merge.
Authored by GPT-5 (Codex Desktop). Session 3b454ac4-f2c6-4bf0-9c18-c0af6f432ffa.
FAIR-band: in-band [16/30 β current author count over last 30 merged]
Refs #10292
Adds #10292 trust-tier weighting to the
get_context_frontierhydration path. Raw memories and summaries already expose/filter provenance; this closes the remaining frontier-ranking gap by projecting summarysourceTrustTierinto semantic contexts and sorting hydrated contexts by a trust-adjusted score.Evidence: L1 (focused MemoryService unit coverage + static diff hygiene) β L1 required (deterministic service ranking behavior). No residuals for this slice.
Deltas from ticket
Refs #10292.getContextFrontier()now addstrustTier,trustWeight, andweightedScoreto each hydrated semantic context.TRUST_TIER_ORDERfromidentityRoots.mjs; higher-trust summaries stay closer to graph topology weight, while lower/unclassified summaries are still returned but rank below equal-weight higher-trust contexts.get_context_frontiercurrently declares a generic object response, and this change is an additive response-field projection.Test Evidence
npm run test-unit -- test/playwright/unit/ai/services/memory-core/MemoryService.TenantIsolation.spec.mjsResult: 16/16 passed.
Result: passed.
Post-Merge Validation
Commits
23084f467βfeat(memory-core): weight frontier contexts by trust tier (#10292)Evolution
The implementation stayed deliberately narrow after the #12000 merge: V-B-A showed
MemoryService.getContextFrontier()already hydrates summary metadata, but did not rank or projectsourceTrustTier. Reusing the existing trust-tier order avoided a new ranking taxonomy.