Skip to content

Restore optional inserter cleanup for adjustable inserter mods - #13

Merged
jatmn merged 1 commit into
release/1.3.0from
codex/issue-12-inserter-cleanup
Oct 8, 2026
Merged

jatmn merged 1 commit into
release/1.3.0from
codex/issue-12-inserter-cleanup

Conversation

@jatmn

@jatmn jatmn commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Restore the missing opt-in startup setting for hiding redundant Yuoki inserter recipes. The option appears with Bob's Adjustable Inserters, Smart Inserters, Quick Adjustable Inserters, or Inserter Configuration and defaults to disabled.

Enabling it hides and disables eight specialized recipes: L.S.I. Prototype 23, Smart D-Left/Right Mover, ISL/ISR Mover, Prototype 207-d, and Evade L/R-Handle. Standard fast, smart/stack, and 4R inserters remain available; existing items and placed inserters remain intact. Save reconciliation clears stale enabled flags and restores current recipe defaults or researched unlocks when cleanup is turned off or the adjustable mod is removed. Cleanup runs before technology addons assign unlocks.

Fixes #12. Based directly on release/1.3.0, at ccbd5bb38142a15e8c022326e2dea73fd30113c9. The pending Factorio 2.1 port in #11 remains separate; no version bump is included.

Validation:

  • Official Factorio 2.0.76 + Space Age, actual Bob's 2.0.3 source: fresh saves with cleanup off/on, saved-game toggles both ways, and removal of Bob's pass. Checks include all eight recipes, standard variants, separate forces, placed entities, and stocked inventory.
  • Official Factorio 2.1.21 + Space Age, actual Bob's 3.0.0 source: combined with Yuoki port ce7918f, Engines dd13f42, and Quinityn PR #8 33fe646, fresh/save-toggle tests pass. Hidden variants receive no research unlocks; restoration respects researched and unresearched forces.
  • Native detection tests pass for the three additional IDs, no supported mod, and an excluded limited adjuster. These use minimal dependency stubs and do not prove full alternative-mod gameplay compatibility.
  • The original missing setting and stale saved recipe state were reproduced before correction. Every changed hunk reviewed; git diff --check passed. Isolated native fixtures and logs are retained in the task workspace; no graphical playthrough was performed.

Reviewed and validated commit: 87144db9d38501303392c6ca928c23095bfdf367.

Summary by Sourcery

Restore optional cleanup and save-state reconciliation for specialized Yuoki inserter recipes with supported adjustable-inserter mods.

New Features:

  • Add an opt-in startup setting to hide and disable eight specialized Yuoki inserter recipes when a supported adjustable-inserter mod is installed.

Bug Fixes:

  • Restore inserter recipe availability and researched unlocks when cleanup is disabled or the supporting adjustable-inserter mod is removed, including reconciliation of saved games.

Enhancements:

  • Preserve standard inserter recipes, existing items, and placed inserters while applying the optional cleanup before technology unlock processing.

Documentation:

  • Document the new inserter cleanup setting, its supported integrations, affected recipes, and default behavior.

@jatmn jatmn self-assigned this Oct 8, 2026
@jatmn
jatmn marked this pull request as ready for review October 8, 2026 03:59

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="prototypes/integration/adjustable-inserters.lua" line_range="5-6" />
<code_context>
+if cleanup and cleanup.value then
+	-- Run before technology addons assign unlocks. Keep items and entities for saves.
+	for _, name in ipairs(require("scripts.inserter-cleanup-recipes")) do
+		data.raw.recipe[name].hidden = true
+		data.raw.recipe[name].enabled = false
+	end
+end
</code_context>
<issue_to_address>
**Game fails to start**

When another mod removes a listed recipe before this data-stage integration runs with cleanup enabled, `data.raw.recipe[name]` is nil, so indexing `.hidden` or `.enabled` aborts prototype loading and prevents the game from starting.

Check that the recipe prototype exists before setting its fields.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and when enabled, this hides and disables several inserter recipes for existing forces, changing what players can craft and potentially their progression. Turning the setting off or reverting the change can restore the recipe state from researched technologies, so the impact is bounded and repairable rather than involving deleted data or irreversible side effects.

Blocking findings: prototypes/integration/adjustable-inserters.lua:6


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread prototypes/integration/adjustable-inserters.lua
@jatmn

jatmn commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@pullfrog review

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes Reviewed all eight changed files at 87144db, the active loading paths, and the requirements in #12.

  • Conditional setting: Adds a disabled-by-default startup option for the four supported adjustable-inserter mod IDs, with an English description of its scope and range limitations.
  • Prototype cleanup: Hides and disables exactly eight specialized recipes before downstream technology processing, while retaining their item/entity prototypes and the standard fast, smart/stack, and 4R variants.
  • Save reconciliation: Runs during initialization and configuration changes, disables stale recipe flags while cleanup is active, and restores prototype defaults or researched unlocks when cleanup is disabled or the supporting mod is removed.

Independent validation passed with official Factorio 2.0.76 + Space Age: fresh saves with cleanup off/on and no supported mod, saved-game toggles in both directions, and removal of the supported-mod detection stub. Assertions covered all eight recipes, default-enabled and research-gated restoration, researched/unresearched forces, standard variants, stocked items, and placed entities. These tests used a minimal bobinserters detection stub and a synthetic technology fixture, not the actual adjustable mods or Quinityn; full third-party gameplay compatibility, Factorio 2.1, and graphical behavior were not independently retested in this review.

The earlier nil-prototype concern is not supported by the active load route: Yuoki unconditionally defines all eight recipes immediately before requiring cleanup, without another mod's execution interleaving between those calls. The repository working tree remains clean.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@jatmn
jatmn merged commit c865cf0 into release/1.3.0 Oct 8, 2026
3 checks passed
@jatmn
jatmn deleted the codex/issue-12-inserter-cleanup branch October 8, 2026 16:29
@jatmn jatmn linked an issue Oct 8, 2026 that may be closed by this pull request
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.

Missing Bob's Inserters cleanup startup setting

1 participant