Skip to content

Feat/v5#49

Draft
mCodex wants to merge 45 commits into
mainfrom
feat/v5
Draft

Feat/v5#49
mCodex wants to merge 45 commits into
mainfrom
feat/v5

Conversation

@mCodex

@mCodex mCodex commented Jul 20, 2026

Copy link
Copy Markdown
Owner

No description provided.

mCodex added 4 commits July 17, 2026 11:26
…el catalog, model registry, online models, performance budget, replay, resource loot reward, runtime, safety envelope, snapshot builder, tactical blackboard, tactical states, target proposal, UI bridge, and UI presenter

- Implement tests for lifecycle initialization and termination
- Verify loader order for unified tick and event bus
- Ensure metrics maintain bounded counters, gauges, and samples
- Test model catalog registration and lifecycle
- Validate model registry behavior and evidence handling
- Check online models for streaming statistics and Markov state predictions
- Assess performance budget degradation of optional work
- Confirm deterministic replay functionality
- Evaluate resource and loot observation handling
- Test runtime initialization and lifecycle management
- Validate safety envelope for decision-making
- Ensure snapshot builder reconciles spectators correctly
- Test tactical blackboard for owner validation and expiration
- Validate tactical proposal states for lure and pull behaviors
- Ensure target proposal adapts legacy targets correctly
- Verify UI bridge exposes required sections
- Test UI presenter for state mapping and command execution

Update ring buffer utility to export globally and bump version to 5.0.0
…with v5 API updates

- Updated discovery_spec.lua to enhance test coverage for the Discovery orchestrator, including state transitions and policy states.
- Revised readiness_spec.lua to incorporate backward compatibility and new role-based readiness checks.
- Enhanced scheduler_spec.lua with additional tests for action processing, acknowledgment, and backoff mechanisms.
- Improved state_machine_spec.lua to reflect new state definitions and transition logic, including terminal state checks.
- Added comprehensive tests for tactical intelligence in tactical_intelligence_spec.lua, ensuring accurate model diagnostics and unified read models.
- Updated bot_doctor_spec.lua to include new checks for actionable intelligence issues and performance metrics.
- Modified ui_bridge_spec.lua to reflect changes in UI sections for the Tactical Intelligence window.
…ning to Tactical Intelligence

- Deleted HuntAnalyzer and its associated UI components.
- Updated analytics event names to reflect the new Tactical Intelligence framework.
- Refactored intelligence runtime to publish canonical events for session management and loot observation.
- Enhanced model catalog to use a neutral prior for fresh predictions.
- Improved monster profiling by integrating telemetry data into Tactical Intelligence.
- Updated documentation to reflect changes in analytics reporting and module integration.
- Added unit tests for new functionality and legacy cleanup.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fbd4faf-d79f-4580-a50a-bbfb278959ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

mCodex and others added 25 commits July 20, 2026 11:50
Defines 20 closure reasons and 5 ambiguous reasons for episode
state machine validation. Provides isValid(), isAmbiguous(), and
all() API. Registered as nExBot.IntelligenceOutcomeReasons.
Defines IntelligenceEventSchema with SCHEMA_VERSION, TYPES enum,
REQUIRED_FIELDS, and validation helpers (isValidType, requiredFieldsFor,
hasField). Tests cover schema version, all 25 types, common fields,
per-type fields, unknown/nil rejection, and global registration.
Implements bounded event deduplication with LRU eviction for the
intelligence pipeline. Tracks both eventId and idempotencyKey with
proper cleanup on eviction. 16 tests covering all API surface.
Removed player:health, player:mana, container:update, and combat:target
from the second EventBus block — they were already handled by the
sectionTracker block above, causing double dirty-marking.
- OutcomeRecord.new(config): create instance
- record:create(config): create outcome with decisionId, actionId, closureReason
- record:validate(outcome): validate well-formed outcome
- record:measure(outcome, key, value): add measurement to outcome
- Validates closureReason against IntelligenceOutcomeReasons
- 20 passing tests, no regressions
Creates core/intelligence/records/decision_record.lua with create, close,
and validate methods. Follows outcome_record.lua patterns. Includes 29
busted tests covering required field validation, decisionType enum
checking, default prediction table, outcome attachment, and global
registration.
- EpisodeBase.new/create/close/validate/isOpen API
- Validates episode types: action, encounter, loot, route_segment, hunt
- Uses IntelligenceOutcomeReasons for closure validation
- Idempotent close (returns unchanged if already closed)
- Non-mutating close (returns copy)
- 24 passing tests
- Tracker.new(config) with episodeBase dependency
- start/close/get/getOpen/stats API
- 17 passing tests
- Tracker manages loot episode lifecycle via EpisodeBase
- API: start, close, get, getOpen, stats
- Validates required fields, rejects duplicate IDs
- Tracks lootLifecycle counters per episode
- 20 passing tests
- Initialize episodeBase, encounterTracker, lootEpisodeTracker,
  routeSegmentTracker, huntTracker in runtime init block
- Add combat:target_changed handler to start encounter episodes
- Add loot:received handler to start loot episodes
- Set/clear sessionId and huntId on session start/end events
- Use dofile fallbacks for test compatibility
- Cost.new(config) with optional initialCosts
- getCost(action, context), recordCost(action, cost), getAverage(action)
- 7 passing tests
- Add optional eventFactory/eventContext params to LootObserver.new()
- Emit loot_item_observed on each item in observe()
- Add moveAttempted() emitting loot_move_attempted
- Add moveVerified() emitting loot_move_verified
- Register as nExBot.IntelligenceLootObserver
- 13 tests passing, no regressions
- Initialize rewardVector and rewardNormalizer after episode tracker
- Add intelligence:encounter_closed event handler
- Update test fixtures to load reward modules
- target_value_model, route_reliability_model, resource_efficiency_model
- timing_model, risk_assessment_model, loot_opportunity_model
- ensemble_meta_model (combines other model predictions)

Each model extracts contextual features and maintains per-model state.
Dynamic dispatch wrappers ensure method overrides work through registry.

Co-Authored-By: opencode <noreply@opencode.ai>
TDD: 6 tests covering construction, gate evaluation, promotion
eligibility, and insufficient data handling.
mCodex added 16 commits July 21, 2026 09:27
…n explanations

- Explainer.new(config) constructor
- explain(decision) returns explanation table with baseline, selected, adjustment, confidence, factors, guardrails, pricesKnown, modelVersion
- format(explanation) returns readable string
- Handles missing fields gracefully
Replace obsolete model names (NavigationCostModel, MonsterBehaviorModel,
TargetUtilityModel, TargetSwitchModel, LureSafetyModel, PullContinuationModel,
WavePredictionModel) with equivalents from the rewritten model catalog
(RouteReliabilityModel, TargetValueModel, RiskAssessmentModel,
ResourceEfficiencyModel, TimingModel).
All 28 new modules created during the v5 ML redesign were missing
from the loader, causing runtime.lua to fail when trying to load
them via dofile() fallback. Added them in dependency order before
intelligence/runtime.
…vider, kill_switch

Three modules used bare globals instead of nExBot.X registration,
causing runtime.lua to fail loading when the loader couldn't find them.
This cascade-failed everything downstream (applyContextAdjustment,
advanceGeneration, etc.)
OTClient uses Lua 5.1/LuaJIT where unpack is a global function,
not table.unpack (which doesn't exist pre-5.2).
OTClient's sandbox apparently strips both unpack and table.unpack
from globals. The existing shim in event_bus.lua only fires if
unpack exists (which it doesn't here). Replaced with a simple
ipairs-based copy function.
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.

1 participant