Skip to content

Client mode + demo golden lock (engagement-ready) - #3

Open
MsShawnP wants to merge 4 commits into
mainfrom
client-mode-2026-08
Open

Client mode + demo golden lock (engagement-ready)#3
MsShawnP wants to merge 4 commits into
mainfrom
client-mode-2026-08

Conversation

@MsShawnP

@MsShawnP MsShawnP commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Engagement-ready client-mode conversion. Verified; source-only and demo-locked.

Every listed P1 was already fixed on disk, verified by the audit's reproduction, then regression-locked. Demo golden byte-identical; client mode + adversarial fixtures added.

Deploys trigger on push to main only — merging this PR is what goes live. Nothing has deployed from pushing the branch. CI (canonical-drift / ci / render) runs on this PR.

Commits (4):

  • Add edi-preflight client mode (engagement.yml + provenance report)
  • Fix README test count to match actual (edi-preflight)
  • Lock demo golden (edi-preflight)
  • Engagement scaffold: gitignore + deploy guard

🤖 Generated with Claude Code

MsShawnP and others added 4 commits August 3, 2026 13:17
Pin the engine output on the two files the deployed demo serves
(src.main._SAMPLE_FILES): walmart/856_bad_dtm.edi validation findings
(4 findings, 3 may-cause + 1 will-cause, $1/case breakdown) and
walmart/850_with_allowances.edi extraction (PO 4500012400, 3 lines,
6 allowances). Guards the live demo against drift during the
client-mode conversion. Runs under CI's `pytest tests/`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 07-31 audit corrected 312 -> 322 and it stuck; the demo golden lock
adds 5 tests, so `pytest tests/` now reports 327 across 21 modules.
No logic change; documentation only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire the existing X12 engine to the shared lailara_engagement scaffold so a
client's own 850/856 files can be pre-flighted locally:

- client_mode.py: tolerant intake of a single EDI file or a directory
  (UTF-8/Latin-1, delimiters auto-detected), a preflight that names any
  unreadable/non-EDI input (Data Readiness Report when nothing is usable), a
  partner-ID map in engagement.yml that steers retailer selection without
  editing code, then runs extract_850 / validate_856 + retailer rules and emits
  a branded, provenance-footed (input SHA-256, segment/transaction counts,
  as_of_date, config hash, validation status), DRAFT-watermarked report to
  client-output/ only. Chargeback fees are shown per basis, never summed.
- engagement.demo.yml: safe-to-run demo config (demo: true) with an example
  partner map.
- INPUT-SPEC.md: input contract derived from the engine code (envelope, 850,
  856, and the partner-ID config), written for a client's IT/EDI person.
- tests/test_client_mode.py: adversarial suite (blocked non-EDI input, clean
  ASN, Latin-1 file, partner-map resolution, unresolved-retailer fallback,
  directory intake, 850 path, final-flag watermark) — importorskip so it skips
  where lailara_engagement isn't installed (e.g. CI).
- README: documented "Client engagement use"; test count now 22 modules.

Demo mode is untouched: no change to src/ or samples/, and the demo golden lock
still passes. All 335 tests pass (327 core + 8 client-mode with the lib present).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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