Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41057289b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bundle.stage = stage; | ||
| bundle.stageIndex = stageIndex.get(stage); | ||
| bundle.lastSeenAt = timestamp; |
There was a problem hiding this comment.
Derive current state from the newest event timestamp
When an older scan is delivered after a newer one, such as during offline replay or ingestion of an unsorted event file, these unconditional assignments make arrival order rather than event.timestamp determine the bundle's current state. The late old event can regress its stage, quantity, and line and consequently corrupt getWIP() and getAging(); only replace current fields when the event is newest, or recompute them from a chronologically ordered history.
Useful? React with 👍 / 👎.
|
|
||
| for (const bundle of bundles.values()) { | ||
| const line = bundle.line || 'UNASSIGNED'; | ||
| if (!result[line]) result[line] = { bundles: 0, pieces: 0, stages: {} }; |
There was a problem hiding this comment.
Use prototype-safe dictionaries for line summaries
When an accepted line identifier matches an Object.prototype property such as __proto__ or constructor, result[line] resolves to the inherited value and skips initialization. For __proto__, the following increments mutate Object.prototype before the stage lookup throws, so a crafted production event can both crash getLineSummary() and pollute the process; use a Map, null-prototype objects, or own-property checks for both identifier-indexed dictionaries.
Useful? React with 👍 / 👎.
Summary
Builds the first useful GitHub authority asset for garment-factory production tracking inside the existing CMT Factory Toolkit.
Added
Updated
SEO / authority intent
This is deliberately not a backlink-only asset. The repo contains reusable code, sample data, documentation and a standalone demo. The contextual Scan ERP links point to the relevant production-tracking / QR guides.
Verification
The production tracker test was run locally and passed before opening this PR.
Related strategy discussion: drmcoder/scan-erp#7