Add Inventory Modelling: Four Methods (monthly), and move model links to the apex domain - #3
Merged
Merged
Conversation
Percent of COGS, days inventory outstanding and unit build computed side by side on the same business, with a single switch driving which one feeds working capital, cash flow and the balance sheet. The three methods agree within 0.4% in year 1 and are EUR 865k apart by year 5. The P&L is identical on all three, so the whole difference lands in closing cash. Balance check verified at 0 on all five periods and on all three methods. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
layerz.cc became the canonical origin on 2026-08-06; app.layerz.cc now 308s to it. Every Open in Layerz button, OG card and workflow URL in this repo still pointed at app., so each one took a redirect hop. The check-links workflow was about to break on it: it asserts a bare 200 and app.layerz.cc/models/<id> answers 308. Its last green run was 2026-08-03, three days before the migration, so the next scheduled run would have failed on all 12 models. Replayed locally after the sweep: 13 models, 26 URLs, all 200. The id-collection grep now accepts both forms, so a stray app. link in a future page still gets checked rather than silently dropped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A page that ships a dead or mistyped model link was only caught by the Monday cron, after merge and after the page was already public. Adding pull_request to the triggers moves that check before merge. On a pull_request event the checkout is the merge result, so what gets verified is the repo as it would look on main. The job only curls public URLs and needs no secrets, so it works on fork PRs under the read-only token as well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two changes: a new model page, and a domain sweep the repo had been missing since the apex migration.
New model: Inventory Modelling: Four Methods (monthly)
Open in Layerz ·
models/inventory-methods/Four ways to forecast inventory, computed side by side on the same business over 72 months, each in its own tab. One
Inventory method switchdecides which one feeds working capital, cash flow and the balance sheet. Nothing downstream references a method directly.A, B and C are calibrated to agree within 0.4% in 2025 and are 865,398 apart by 2029, because a fixed ratio cannot express an efficiency gain: method A's implied days never move.
Why monthly. The model was originally yearly. It could not express stock ageing at all: on flat annual flows a "last 180 days of purchases" rule is just a DIO of 180 in disguise. 2024 is a ramp-in year that gives the trailing-12-month windows a full history and absorbs the working capital build; results are read from 2025.
What method D adds. It forecasts purchases and lets the stock follow, rather than inferring the stock from COGS. Under FIFO the remaining stock is always the most recent purchases, so age is a subtraction rather than a layer simulation:
The result is the point of the whole thing: at normal purchasing the write-off never fires, and the stock ages anyway, from 16% to 22% over 60 days. A business turning stock in 60 days never holds anything for 180, so the accounting alarm stays silent for years while a quarter of the warehouse quietly gets old. No ratio method can produce that column.
Balance check verified at 0 on all 72 periods and all four methods, re-run with the switch on each value. Annual P&L totals and the December inventory figures reproduce the earlier yearly build to the euro.
Apex domain sweep
layerz.ccbecame the canonical origin on 2026-08-06 andapp.layerz.ccnow 308s to it. Every Open in Layerz button, OG card and workflow URL in this repo still pointed atapp., so each one took a redirect hop.More pressing:
check-links.ymlwas about to start failing. It asserts a bare200andapp.layerz.cc/models/<id>answers308. Its last green run was 2026-08-03, three days before the migration, so the next scheduled run would have failed on all 12 models. Fixed here and replayed: 13 models, 26 URLs, all 200.The workflow now also runs on pull requests, so a dead or mistyped model link is caught before merge instead of by the next Monday cron. The id-collection grep accepts both forms, so a stray
app.link in a future page still gets checked rather than silently dropped.Notes
origin/mainfirst: it carried four commits that were content-identical duplicates of main's, which the rebase dropped.userscope, notsystem. PerCLAUDE.mdthis catalog and the public template catalog are reconciled deliberately, not assumed to match.🤖 Generated with Claude Code