Skip to content

feat: bind shadow recall profiles to V2 surface admission decisions (#186) - #187

Open
ezutfen wants to merge 2 commits into
mainfrom
feat/186-v2-surface-admission-binding
Open

feat: bind shadow recall profiles to V2 surface admission decisions (#186)#187
ezutfen wants to merge 2 commits into
mainfrom
feat/186-v2-surface-admission-binding

Conversation

@ezutfen

@ezutfen ezutfen commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Closes #186 (ENG-RECALL-003B). Parent #160, epic #153. Depends on #158/#159/#160 (PRs #183/#182/#184, all merged).

Summary

Bind #160's governed/exploratory shadow recall packets to the exact #158 risk_aware_shadow_v1 per-surface decisions, instead of reconstructing candidate admission from review_status, disputed stay-kind logic, and the #159 Path-A projection. Shadow-only: no change to production recall serving authority, promotion authority, or CERTIFIED_SERVING_PROFILES.

Architecture

Shadow-only boundary — confirmed unchanged

  • CERTIFIED_SERVING_PROFILES remains {"legacy"} (test-pinned).
  • POST /v1/recall remains legacy-only; requesting governed/exploratory still 422.
  • Shadow comparison writes nothing: no recall_logs, no exposure counters, no promotion/review/evidence side effects, no shadow-current projections (test-pinned, incl. capture-disabled rollback reads).
  • REVIEW_SCOPE + tenant_config.recall_profile_shadow_enabled still gate the surface; explicit workspace denial still yields no broader fallback.

Verification

  • make check — lint + strict typecheck + root suite green (12 local failures are byte-identical to unmodified main in this environment: missing engram_client/engram_hooks workspace installs + subprocess tests crashing in the local AppImage python).
  • make compose-cifully green: 3838 passed, 35 skipped, 0 failed against real PostgreSQL + pgvector under the non-owner app role.
  • New/updated tests: golden parity matrix (ENG-PROMOTION-003C — Replace the universal 72-hour gate with versioned risk-based admission profiles #158 simulator ↔ resolver: identical decision hashes and surfaces across qualified-low / medium pre-post-72h / high-risk / absent / contested / governance-review / conflict states), age-only-changes-window, fail-closed matrix (missing/stale/mismatched/unsupported + input-digest drift + newest-row-wins), surface-mapping matrix, ENG-PROMOTION-003D — Persist promotion assessments and expose next-action state #159 defense-in-depth precedence, pre-LIMIT window starvation regression, cross-tenant FORCE-RLS invisibility, read-only proof, constant query count + no provider calls, deterministic-fixture latency recording, page-vs-item simulator parity, plus reworked unit contracts for the gate and profile registry.

Documentation

Non-goals honored

No #161 corroboration lane, no evidence-root redesign, no positive-feedback admission, no #162 certification run, no production governed/exploratory rollout, no signal-aware expansion or final packing work. #161/#162 production enablement is not authorized by this PR.

…186)

Bind #160's governed/exploratory shadow recall packets to the exact #158
risk_aware_shadow_v1 per-surface decisions instead of reconstructing
admission from review_status, disputed stay-kind logic, and the #159
Path-A projection.

- admission_shadow: shared bulk V2 resolver (resolve_bulk_v2_decisions) —
  fresh exact evaluation + latest persisted V2 row, classified
  current/missing/stale/mismatched/unsupported; simulate paths share the
  same evaluation core and bulk #157 selection (no per-item N+1).
- assessments: bulk effective #157 selection over one shared pure core.
- recall_signals: fail-closed V2 surface gate (recall-admission-v2) with
  full safe binding block; local rules (lifecycle, #159 blocked/stale)
  remain withhold-only defense in depth.
- recall: live-proposal corpus predicate before the bounded HNSW window;
  bounded content-free admission diagnostics + resolution summary.
- recall_shadow/route: recall-shadow-compare-v2 additive payload.
- ADR-160 supplement; shadow-only boundary unchanged
  (CERTIFIED_SERVING_PROFILES == {legacy}).
…l withholds (#186)

Review corrections to the #186 V2 surface admission binding, with no
change to the shadow-only serving boundary:

- Blocker 1: V2-bound profiles dispatch through the surface gate before
  the profile-generic #159 pre-check, so a local blocked/strict-stale
  withhold keeps the resolved V2 binding (resolution status, exact
  surface decision, persisted/fresh identity) instead of reading as
  missing; local precedence for the decision and primary reason code is
  unchanged, and the withheld result also carries the #159 assessment
  identity.
- Blocker 2: withheld-candidate admission diagnostics now embed the same
  full safe v2 binding block admitted items carry (persisted + fresh
  identity, exact surface decision, bounded state/code sets), reusing the
  single binding builder.
- Blocker 3: V2SurfaceBinding splits persisted-row identity (read from
  the row's own columns) from the fresh evaluation's identity; stale
  hashes, mismatched artifact digests, and unsupported schemas stay
  individually visible instead of being collapsed into fresh fields.
- Minor: resolve_bulk_v2_decisions reports the number of queries actually
  executed (the bulk #157 selection counts its early returns) rather than
  a flat ceiling; constant in window size either way.
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.

ENG-RECALL-003B — Bind shadow recall profiles to V2 surface admission decisions

1 participant