openspec: Phase 6 T6 — Rung-2 chemical gradients + adaptive chemosensory sensor (plan) - #218
Conversation
…idelity plan) Full-T6 OpenSpec change (proposal → design → specs → tasks), strict-valid: - proposal: new capability chemical-gradient-fidelity (static Fick gradient geometry + adaptive chemosensory sensor); modified continuous-2d-environment (float sources + Euclidean/continuous-field, lifting the T5 deferrals) and klinotaxis-sensing (adaptive transform on strength/derivative). - design: D1 adaptive sensor (background-tracking leaky integrator + relative coding; exact readout settled by the step-input gate — co-primary candidates are derivative-channel fold-change (dC/dt)/C and instantaneous magnitude contrast; channel-interaction is an explicit behavioural contract); D3 static Fick = frozen analytic Gaussian kernel exp(-r²/4Dt), exponential kernel stays default-off for grid byte-stability; D4 float sources confined to continuous env; D6 bounded iteration sub-tranche; D7 step-input adaptation-transient gate. Dynamic-diffusion PDE kept an explicitly-gated stretch. - specs: 3 deltas (1 ADDED capability + 2 MODIFIED). - tasks: 8 groups, dependency-ordered (field+sources → sensor → renderer → validation → logbook), mapped to the phase6-tracking T6 rows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three should-fix findings from nematode-review-spec (all verified against code): - S1: "reuse STAM machinery" was optimistic — STAMBuffer exposes no public baseline API (weighted mean is private to get_memory_state). D1 + task 3.1 now call for a shared leaky-integrator utility following STAM's decay pattern. - S2: the *_klinotaxis_core logic is duplicated across ~9 per-channel functions (no chokepoint). Scoped the adaptive transform explicitly to chemosensory channels (food chemotaxis + pheromone/CO2) in the klinotaxis-sensing delta + task 3.3; must not alter thermo/nociception/predator channels. - S3: fold-change (dC/dt)/C is singular at C≈0 (common far from a source). Regularised to (dC/dt)/(C+ε) in D1, the chemical-gradient-fidelity spec, and task 3.2. Plus minor clarifications: named the config integration points (ForagingConfig for field-mode/D, SensingConfig + validate_sensing_config for the adaptive sensor); scoped the Fick kernel to chemical (not predator) fields. openspec validate --strict: valid. Targeted pre-commit: green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis pull request introduces the complete design, specification, and implementation roadmap for the Phase 6 Rung-2 chemical gradients upgrade. The changes define an adaptive chemosensory sensing model, a static Fick-shaped gradient field geometry with float-based continuous-2D source placement, heading-aware klinotaxis sampling, continuous-substrate rendering capabilities, and an ordered task checklist with validation gates. ChangesRung-2 Chemical Gradients Upgrade
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Draft — planning artifact for review, not implementation. This PR is the authored + self-reviewed OpenSpec change for Phase 6 Tranche 6 (env fidelity). No code yet; it's the proposal/design/specs/tasks the implementation PRs will work from.
Scope (full T6, one change)
Per the
phase6-trackingtracker T6 rows, on top of the T5 continuous-2D substrate (Gate 2 GO, logbook 027):(dC/dt)/(C+ε)vs instantaneous magnitude contrast).A·exp(−r²/4Dt)with per-signal D; exponential kernel stays default-off → grid byte-stable.Capabilities
chemical-gradient-fidelity(static Fick geometry + adaptive sensor + step-input validation).continuous-2d-environment(float sources + Euclidean/continuous-field) andklinotaxis-sensing(adaptive transform on the chemosensory cores).Self-review (
nematode-review-spec)No blocking findings; all file:line references verified against current code. Three should-fix items resolved before this PR: S1 STAM-reuse softened to a shared leaky-integrator utility (no public baseline API exists); S2 adaptive transform scoped explicitly to chemosensory channels (
*_klinotaxis_corelogic is duplicated across ~9 functions, no chokepoint); S3 fold-change regularised(dC/dt)/(C+ε)(singular at C≈0). Config integration points named; Fick kernel scoped to chemical (not predator) fields.openspec validate add-rung2-chemical-gradients --strict: valid. Targeted pre-commit: green.Deliberately deferred to implementation/empirics (not gaps)
t_assaycalibration → anchored to the tuned continuousdecay≈8.🤖 Generated with Claude Code
Summary by CodeRabbit