Skip to content

decouple dopamine action gate from concrete controller#1417

Merged
neuron7xLab merged 15 commits into
mainfrom
dopamine-action-gate-decoupling
Jun 30, 2026
Merged

decouple dopamine action gate from concrete controller#1417
neuron7xLab merged 15 commits into
mainfrom
dopamine-action-gate-decoupling

Conversation

@neuron7xLab

@neuron7xLab neuron7xLab commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Status

Draft stress-hardening pass after PR #1416. The PR is intentionally not ready for merge until the new stress witnesses and required gates pass on the current head.

Claim

ActionGate should depend on the minimal structural capability it needs, not on the concrete DopamineController implementation.

Falsifiers

  1. A non-DopamineController provider with only temperature_bounds() and optional _log() must be sufficient to drive ActionGate.
  2. action_gate.py must not import or name the concrete DopamineController implementation.
  3. ActionGate must re-query structural temperature bounds across evaluations, so dynamic physics-bound providers are not flattened into stale initialization state.
  4. ActionGate must survive bounded extreme dopamine/serotonin/GABA/NA-ACh modulation grids while keeping score, dopamine level, decision flags, and temperature inside declared bounds.

Change

  • Introduce TemperatureBoundsProvider Protocol.
  • Remove concrete DopamineController import from action_gate.py.
  • Store a temperature-bound callable for evaluation while preserving a structural _dopamine provider alias for backward-compatible invariant probes.
  • Add structural-provider witness.
  • Add isolated import-boundary source witness.
  • Add dynamic structural-bound witness.
  • Add bounded 600-case modulator stress witness.
  • Bind boundary/stress witnesses in the commit acceptor.

Boundaries

No trading, execution, forecast, or policy changes. No market-edge claim. No behavior change intended for existing DopamineController callers.

Merge rule

Do not mark ready or merge until the current head is terminal green across required checks after the stress-hardening pass.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f4fbf7475

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/commit_acceptors/dopamine-action-gate-decoupling.yaml Outdated

Copy link
Copy Markdown
Owner Author

АКТ ОПЕРАЦІЙНО-ІНТЕГРАЦІЙНОЇ ГОТОВНОСТІ — PR #1417

Об’єкт: neuron7xLab/GeoSync PR #1417
Назва: decouple dopamine action gate from concrete controller
Head: 5d9315a8760d02f44bdc95f957bcd8f8683abb5c
Статус: integration candidate, not merged, not final until PR Gate terminal success

1. Вхід задачі

Довести PR #1417 до стану, де claim “ActionGate не залежить від concrete DopamineController” є не текстовою заявою, а перевіреним інтеграційним фактом.

2. Мінімальний контекст

PR не змінює trading, execution, forecast або policy logic. Сфера PR обмежена structural decoupling: ActionGate має залежати від мінімального provider-контракту, а не від concrete controller class.

3. Атомарні задачі

A. Structural boundary validation
Вхід: action_gate.py, structural-provider tests, import-boundary witness.
Вихід: ActionGate приймає provider з temperature_bounds(), без concrete controller import.
Критерій завершення: commit acceptor + import architecture + targeted tests green.

B. Static quality validation
Вхід: changed Python files.
Вихід: ruff, black --check, mypy success.
Критерій завершення: python-quality success.

C. Fast deterministic validation
Вхід: full fast pytest surface, sharded across 4 jobs.
Вихід: python-fast-shard 1/2/3/4 success.
Критерій завершення: python-fast-tests aggregator success.

D. Heavy invariant validation
Вхід: slow/heavy/nightly pytest lane.
Вихід: python-heavy-tests terminal success.
Критерій завершення: PR Gate terminal success.

E. Integration
Вхід: terminal green head with unchanged SHA.
Вихід: merge commit into main.
Критерій завершення: head-locked merge only if PR Gate and all required checks are terminal success.

4. Stress-validation protocol

Stress-1: CI reality stress
Run all required PR gates to terminal verdict. No merge on partial green.

Stress-2: Boundary stress
Confirm that a non-DopamineController provider drives ActionGate and that action_gate.py contains no concrete DopamineController dependency.

Stress-3: Integration stress
Confirm that fast + heavy gates pass on the exact head SHA intended for merge. If head changes, restart validation from A.

5. Anti-procrastination rule

Do not patch without a counterexample.
Do not rerun green lanes while the required release gate is still active.
Do not mix CI-infrastructure refactor into this product-decoupling PR unless the active gate fails on that exact surface.

6. Current verdict

FAST LANE: PASSED
STATIC QUALITY: PASSED
STRUCTURAL BOUNDARY: PASSED
PR GATE: ACTIVE
HEAVY VALIDATION: NOT YET TERMINAL
MERGE: FORBIDDEN UNTIL PR GATE TERMINAL GREEN

7. Final integration rule

If PR Gate becomes terminal success on head 5d9315a8760d02f44bdc95f957bcd8f8683abb5c, merge head-locked.
If PR Gate fails, extract failing job, failing step, logs, and patch only the falsified condition.
If logs are non-actionable, create a separate CI observability PR: heavy tee + rc summary + failing-node extraction + duration telemetry.

@neuron7xLab neuron7xLab enabled auto-merge (squash) June 30, 2026 06:05
@neuron7xLab neuron7xLab marked this pull request as draft June 30, 2026 06:12
auto-merge was automatically disabled June 30, 2026 06:12

Pull request was converted to draft

Copy link
Copy Markdown
Owner Author

Integration hold: bounded falsification is not completeness

This PR is intentionally kept in Draft. It must not be marked ready or merged on the basis of the current bounded stress grid alone.

Current truth:

  • The 600-case grid is a bounded adversarial witness, not a proof over the full continuous state space.
  • Passing CI means no counterexample was found inside the declared boundary, not that no counterexample exists.
  • Absolute completeness is not claimed.

Required before readiness:

  1. Add property-based fuzzing for ActionGate input ranges using the existing dev dependency hypothesis.
  2. Add SMT/interval proof witnesses for score, dopamine, decision-flag, and temperature-bound invariants using the existing dev dependency z3-solver.
  3. Add runtime invariant monitoring or an equivalent fail-closed monitor surface for production-like evaluations.
  4. Bind these witnesses in the commit acceptor so the PR cannot pass on the bounded grid alone.

Merge remains blocked until these controls exist and pass on the current head.

Copy link
Copy Markdown
Owner Author

Formal/fuzz/runtime hardening layer added

New executable witnesses were added to the PR branch:

  • tests/core/neuro/dopamine/test_action_gate_property_fuzz.py
  • tests/core/neuro/dopamine/test_action_gate_smt_invariants.py
  • src/geosync/core/neuro/dopamine/action_gate_runtime_monitor.py
  • tests/core/neuro/dopamine/test_action_gate_runtime_monitor.py

Required verification command:

python -m pytest \
  tests/core/neuro/dopamine/test_action_gate_property_fuzz.py \
  tests/core/neuro/dopamine/test_action_gate_smt_invariants.py \
  tests/core/neuro/dopamine/test_action_gate_runtime_monitor.py \
  -q

This adds three hardening surfaces beyond the 600-case grid:

  1. Hypothesis-generated fuzzing over finite neuromodulator inputs.
  2. Z3/SMT witnesses for declared score and temperature-bound invariants.
  3. A fail-closed runtime monitor module with tests for invalid evaluations and invalid bounds.

Boundary: this still does not prove absolute completeness. It upgrades the PR from fixed-grid falsification to generated-state fuzzing plus solver-backed invariant checks plus runtime monitor coverage. Merge remains blocked while PR is Draft.

@neuron7xLab neuron7xLab marked this pull request as ready for review June 30, 2026 09:46
@neuron7xLab neuron7xLab merged commit 277fc59 into main Jun 30, 2026
58 of 60 checks passed
@neuron7xLab neuron7xLab deleted the dopamine-action-gate-decoupling branch June 30, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant