Multiple fixes for broken master#26
Open
line0 wants to merge 93 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to restore a working “master” by reintroducing missing version-handling functionality, fixing several regressions in module loading and update/feed handling, and adding initial unit-test and line-ending consistency infrastructure.
Changes:
- Added
SemanticVersioningand migrated version parsing/formatting to use it across updater/feed paths. - Fixed/adjusted updater + module-loader behaviors related to initialization and update flows, and added a minimal DepCtrl unit test.
- Updated the project update feed metadata, bumped versions, and enforced LF + final newline consistency.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/DependencyControl/Updater.moon | Migrates updater version handling to SemanticVersioning and adjusts update logging/changelog display. |
| modules/DependencyControl/UpdateFeed.moon | Adds legacy scriptType compatibility + new invalid scriptType messaging; moves DownloadManager init earlier. |
| modules/DependencyControl/UnitTestSuite.moon | No functional change (newline normalization). |
| modules/DependencyControl/Tests.moon | Adds a first unit test for Common.terms.capitalize. |
| modules/DependencyControl/SemanticVersioning.moon | Introduces semantic version parsing/formatting/comparison utilities. |
| modules/DependencyControl/Record.moon | Switches record version parsing to SemanticVersioning and adds compatibility helpers. |
| modules/DependencyControl/ModuleLoader.moon | Updates init-hook guard logic and switches version formatting/parsing to SemanticVersioning. |
| modules/DependencyControl/FileOps.moon | No functional change (newline normalization). |
| modules/DependencyControl/ConfigHandler.moon | No functional change (newline normalization). |
| modules/DependencyControl/Common.moon | Fixes capitalize() implementation to avoid unsupported string indexing. |
| modules/DependencyControl.moon | Bumps DepCtrl version, exposes SemanticVersioning, and adds a Moonscript minimum-version guard. |
| macros/l0.DependencyControl.Toolbox.moon | Bumps toolbox version; updates version formatting and script-type handling; registers DepCtrl test suite. |
| DependencyControl.json | Updates feed versions/hashes and adds new files (including tests) to the module feed. |
| .vscode/settings.json | Enforces final newline on save in VS Code. |
| .gitattributes | Enforces LF line endings in git. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7f7ad69 to
9fee44a
Compare
9fee44a to
ad4a5ec
Compare
Comment on lines
57
to
64
| maxVer = SemanticVersioning\toNumber @version | ||
| minVer = SemanticVersioning\toNumber minVer | ||
|
|
||
| changelog = {} | ||
| for ver, entry in pairs @changelog | ||
| ver = DependencyControl\parseVersion ver | ||
| verStr = DependencyControl\getVersionString ver | ||
| ver = SemanticVersioning\toNumber ver | ||
| verStr = SemanticVersioning\toString ver | ||
| if ver >= minVer and ver <= maxVer |
number segments over 255 and non-dot separate values
…r string is passed
ad4a5ec to
5bc3f45
Compare
nothing inside DepCtrl is supplying this parameter, so the only effect this bug would have had, is removing the default guard against modules trying to load themselves
- assert now passes through all varargs on success (allows chaining) - new assertNotNil method - fails only on nil, unlike assert which also fails on false - dump/dumpToString methods accept a maxDepth to cap recursive table output - new static Logger.describeType method - returns Lua type name but renders MoonScript class instances as "ClassName object" - fix: guard log/format calls against non-string message templates
… message Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ch mode and block reason
Add FeedCache, a URL-keyed on-disk store of timestamped feed snapshots with a freshness window, trimming, and stale-offline fallback. UpdateFeed serves fresh snapshots without the network, persists each fetch, and falls back to a stale copy when offline; UpdateTask reuses it and refuses blocked/never feeds. Add a "prompt" option to fetchUntrustedFeeds: FeedTrust gains a fetch-decision gate and session prompter, and the crawl asks before following untrusted feeds. Toolbox: shared feed-inventory build, a "Fetched" age column, an untrusted-feed prompt, and label-map dispatch. Drops the dumpFeeds config. refactor: validate
`@writeConfig if …` compiled to `return self.writeConfig` — a field access, not a call (missing `!`), so a freshly installed or changed record never wrote itself to the config file. Config-driven tooling (FeedInventory/Toolbox) then couldn't see manually installed scripts and version bumps never synced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…thods They were assigned as class-body fields (@getVersionNumber = SemanticVersioning. toNumber), so `rec\getVersionNumber` — the documented <=0.6.x API — resolved to nil (class fields aren't visible through __base), and toString bound that way would also fail its internal @toNumber call. Restore them as instance methods that default to the record's version and delegate to SemanticVersioning, marked @deprecated. Silent narrowing of a public API is a breaking change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… on load setDefaults recursed into the copy-on-write proxies it built over the defaults tree. Under the runtime's LUA52COMPAT `__pairs` (which the proxies define), that descent iterated a section's real default keys and, for each table-valued one, fired the proxy's write-through __newindex — deep-copying the defaults over the user's live hive. On every global config load this silently wiped the user's extraFeeds/trustedFeeds/blockedFeeds and reset fetchUntrustedFeeds to `always` (a security regression), persisted on the next save. Only `feeds` was hit, as the only section with table-valued defaults, so it surfaced in 0.7.0. Wrap only top-level sections (no descent): a present section is served per-key by the mergeSection fallthrough via @config, and an absent section keeps its first-write copy-on-write. Drop the now-unreachable nested parent-walk. Includes the per-key mergeSection fallthrough that was in progress in the tree, plus a regression test proven to fail on the old recursion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5731374 to
cceac44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes several issues, largely caused by the incomplete refactoring some 10 years ago:
__depCtrlInithooks were called again on - already-initialized modules, causing errors in modules that mutate their exported state on - first call (e.g., BadMutex).,true/falsescript type arguments were - no longer accepted after theScriptTypeenum migration.,DownloadManagerwas instantiated too late, causing the - update process to fail.capitalize()function no longer uses unsupported string indexing and now works - for the first time ever. Before the refactor, this was previously masked by it not actually - being called anywhere.Additionally, i have added a unit test suite for DepCtrl (only 1 tiny test for now) and made all files use LF + EOF Newline to ensure consistent file hashes.