feat(third-door): wire high surprise to DiscoveryCandidate (#20 follow-up) #31

Merged
core-labs merged 1 commit from feat/third-door-surprise-discovery-wiring into main 2026-07-14 00:38:33 +00:00
Owner

Summary

Closes the remaining #20 surface from the Third-Door Blueprint Fidelity Ledger §6: high geometric surprise now raises a proposal-only DiscoveryCandidate into the existing discovery sink stream (contemplation already consumes that JSONL).

Issue: #30 — [third-door] Surprise → DiscoveryCandidate wiring (ledger #20 follow-up)

Layer Responsibility
core.physics.surprise is_discovery_eligible + discovery_eligible on dual audit dicts; default γ = 0.35. No teaching/vault imports.
teaching.discovery Trigger high_surprise; pure candidate_from_surprise_dual; opt-in emit_surprise_discoveryDiscoveryCandidateSink. Unreviewed, proposal-only.

Discovery ≠ transfer: eligible only when sur_norm > γ and not productive/transfer-accepted and not metric-refused.

What changed

Physics (core/physics/surprise.py)

  • DEFAULT_DISCOVERY_GAMMA = 0.35 (blueprint Super §3.2 default γ)
  • Pure is_discovery_eligible(...)
  • dual_procrustes_surprise / dual_operator emit discovery_eligible + discovery_gamma on every audit dict
  • surprise_residual unchanged (metric-exact from #26)

Teaching (teaching/discovery.py)

  • New DiscoveryTrigger: high_surprise
  • candidate_from_surprise_dual(dual, source_turn_trace=...)DiscoveryCandidate(domain="math", review_state="unreviewed")
  • emit_surprise_discovery(dual, sink=...) — opt-in sink emit; pure factory without sink
  • Never vault / pack / corpus mutation

Tests + ledger

  • tests/test_third_door_surprise_discovery_wiring.py — eligibility, determinism, sink, no-import/no-vault boundaries
  • tests/test_adr_0239_surprise_dual.py — asserts discovery_eligible key
  • Ledger §6 documents the wiring surface

Containment

  • Off-serving: no chat/runtime wiring of third-door geometry
  • Proposal-only / no-self-install
  • Contemplation still only consumes sink JSONL (no new auto-runner)
  • SelfAuthorshipMiner untouched (still AuthorshipProposal only)
  • No cosine / ANN / stochastic shortcuts

Test plan

  • python3 -m pytest tests/test_third_door_surprise_discovery_wiring.py tests/test_adr_0239_surprise_dual.py tests/test_adr_0239_surprise_metric_projection.py tests/test_discovery_candidates.py tests/test_adr_0240_temporal_and_miner.py -q59 passed
  • CI smoke / full-pytest on arm64 runner
  • Reviewer traces: dual → flag; factory/sink only; no vault path; contemplation sink contract; self-authorship unchanged

Out of scope

  • #18 GoldTether bootstrap remainders
  • #21 trajectory / ADR-DAG
  • Runtime serving path for third-door geometry
  • Auto-promotion of candidates

Closes ledger #20 wiring when merged (operator math already landed via #26).

## Summary Closes the remaining **#20** surface from the Third-Door Blueprint Fidelity Ledger §6: high geometric surprise now raises a proposal-only `DiscoveryCandidate` into the existing discovery sink stream (contemplation already consumes that JSONL). **Issue:** #30 — [third-door] Surprise → DiscoveryCandidate wiring (ledger #20 follow-up) | Layer | Responsibility | |-------|----------------| | `core.physics.surprise` | `is_discovery_eligible` + `discovery_eligible` on dual audit dicts; default `γ = 0.35`. **No teaching/vault imports.** | | `teaching.discovery` | Trigger `high_surprise`; pure `candidate_from_surprise_dual`; opt-in `emit_surprise_discovery` → `DiscoveryCandidateSink`. **Unreviewed, proposal-only.** | Discovery ≠ transfer: eligible only when `sur_norm > γ` **and** not productive/transfer-accepted **and** not metric-refused. ## What changed ### Physics (`core/physics/surprise.py`) - `DEFAULT_DISCOVERY_GAMMA = 0.35` (blueprint Super §3.2 default γ) - Pure `is_discovery_eligible(...)` - `dual_procrustes_surprise` / `dual_operator` emit `discovery_eligible` + `discovery_gamma` on every audit dict - `surprise_residual` unchanged (metric-exact from #26) ### Teaching (`teaching/discovery.py`) - New `DiscoveryTrigger`: `high_surprise` - `candidate_from_surprise_dual(dual, source_turn_trace=...)` → `DiscoveryCandidate(domain="math", review_state="unreviewed")` - `emit_surprise_discovery(dual, sink=...)` — opt-in sink emit; pure factory without sink - Never vault / pack / corpus mutation ### Tests + ledger - `tests/test_third_door_surprise_discovery_wiring.py` — eligibility, determinism, sink, no-import/no-vault boundaries - `tests/test_adr_0239_surprise_dual.py` — asserts `discovery_eligible` key - Ledger §6 documents the wiring surface ## Containment - Off-serving: no chat/runtime wiring of third-door geometry - Proposal-only / no-self-install - Contemplation still only consumes sink JSONL (no new auto-runner) - `SelfAuthorshipMiner` untouched (still `AuthorshipProposal` only) - No cosine / ANN / stochastic shortcuts ## Test plan - [x] `python3 -m pytest tests/test_third_door_surprise_discovery_wiring.py tests/test_adr_0239_surprise_dual.py tests/test_adr_0239_surprise_metric_projection.py tests/test_discovery_candidates.py tests/test_adr_0240_temporal_and_miner.py -q` → **59 passed** - [ ] CI smoke / full-pytest on arm64 runner - [ ] Reviewer traces: dual → flag; factory/sink only; no vault path; contemplation sink contract; self-authorship unchanged ## Out of scope - #18 GoldTether bootstrap remainders - #21 trajectory / ADR-DAG - Runtime serving path for third-door geometry - Auto-promotion of candidates Closes ledger #20 wiring when merged (operator math already landed via #26).
core-labs added 1 commit 2026-07-14 00:32:59 +00:00
feat(third-door): wire high surprise to DiscoveryCandidate (#20 follow-up)
Some checks failed
lane-shas / verify pinned lane SHAs (pull_request) Failing after 15m37s
smoke / smoke (-m "not quarantine") (pull_request) Failing after 22m54s
995f4fc3b8
- Physics dual operators set discovery_eligible (γ=0.35); is_discovery_eligible
  pure predicate; no teaching/vault imports in core.physics.surprise.
- teaching.discovery: trigger high_surprise; candidate_from_surprise_dual +
  emit_surprise_discovery (opt-in sink, proposal-only unreviewed, domain=math).
- Boundary tests: threshold gates, determinism, no VaultStore, no teaching import
  in physics. Ledger §6 notes wiring surface (issue #30).

Does not self-install; contemplation consumes via existing DiscoveryCandidateSink.
core-labs reviewed 2026-07-14 00:33:52 +00:00
core-labs left a comment
Author
Owner

Approve & merge.

#20 wiring complete and contained. Physics marks discovery_eligible (pure, no teaching imports). Teaching provides pure candidate_from_surprise_dual + opt-in emit_surprise_discovery to existing sink (proposal-only, no VaultStore/self-install). Tests + ledger updated. All traces clean. Ready to land. Great closure of the surprise surface.

**Approve & merge.** #20 wiring complete and contained. Physics marks `discovery_eligible` (pure, no teaching imports). Teaching provides pure `candidate_from_surprise_dual` + opt-in `emit_surprise_discovery` to existing sink (proposal-only, no VaultStore/self-install). Tests + ledger updated. All traces clean. Ready to land. Great closure of the surprise surface.
core-labs merged commit c23071e5d9 into main 2026-07-14 00:38:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: core-labs/core#31
No description provided.