Skip to content

Add garment production tracking reference module and WIP demo - #1

Open
drmcoder wants to merge 10 commits into
mainfrom
feat/production-tracking-authority
Open

drmcoder wants to merge 10 commits into
mainfrom
feat/production-tracking-authority

Conversation

@drmcoder

Copy link
Copy Markdown
Owner

Summary

Builds the first useful GitHub authority asset for garment-factory production tracking inside the existing CMT Factory Toolkit.

Added

  • event-based garment production tracker
  • bundle timeline
  • WIP by stage
  • piece counts by stage
  • line summary
  • aging and stuck-bundle detection
  • duplicate-event protection
  • sample production event CSV
  • runnable Node example
  • standalone static WIP dashboard demo
  • production-tracking architecture guide
  • Node 18/20/22 CI test workflow

Updated

  • exports production tracker from the package root
  • adds npm test
  • rewrites README around actual repository contents
  • reduces promotional linking and uses contextual Scan ERP deep links with UTM attribution

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment on lines +91 to +93
bundle.stage = stage;
bundle.stageIndex = stageIndex.get(stage);
bundle.lastSeenAt = timestamp;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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: {} };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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