feat(erp-engine): op-group atomicity (I-K) + rate-as-op-input (I-J) + BigDecimal enforced#8
Open
red1oon wants to merge 6 commits into
Open
feat(erp-engine): op-group atomicity (I-K) + rate-as-op-input (I-J) + BigDecimal enforced#8red1oon wants to merge 6 commits into
red1oon wants to merge 6 commits into
Conversation
… BigDecimal enforced Browser write-path engine work, under the delegate-to-install spine decision. - I-K op-group atomicity: kernel commitGroup (N ops, ONE group hash, all-or-none, sealed once from tip — which also flattens the I-D O(n^2) per-op reseal). UI commitProcess now commits the doc action via commitGroup. The consequence set (ship/invoice/postings) is a NON-INVENT, clearly-marked DELEGATED extension point (install-side I-C/I-G), never fabricated in the browser. - I-J rate-as-op-input: assertRateAsInput guard wired into commitGroup — a conversion-bearing op MUST carry rate/rateDate/rateSource or the whole group rejects (multi-currency disabled until rate-as-input). - BigDecimal enforced: bigdecimal.js loaded in glassbowl.html before the kernel; the I-J conversion math uses exact BigDecimal, never raw JS float. Witnesses (all PASS, re-run independently): poc_opgroup, poc_crud_group, poc_rate_input, poc_chain, poc_kernel. Real-browser localhost probe PASS. Postgres-15 primitive benchmark (bench_oplog_pg) — honest storage-only scope, no over-claim. Kernel v8. site/ is the gitignored publish mirror of build/erp/. Tracker + decisions: prompts/ENGINE_FULL_ERP_ISSUES.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e tracker Captures the final session state in ENGINE_FULL_ERP_ISSUES.md (was written after the first commit): bigdecimal.js loaded in glassbowl.html + I-J conversion via exact BigDecimal (browser-verified); deployed to feat/erp-write-path-ik-ij / PR #8. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s exact == golden report_overlay.js foldReceipt/foldTrialBalance/foldPnL now accumulate in BigDecimal (exact 2dp string leaf, balanced via exact isZero) instead of raw Number+round2. Probed first: the real divergence is signed sub-cent + magnitude >2^53c (MEASURED, not "round2 is broken"). Witness poc_money_fold.js §MONEY-FOLD PASS (11/11): OLD raw fold diverges from java.math.BigDecimal, LIVE folds == proven golden. test_report_* updated to the exact-string contract (ALL PASS). erp_postings.js audited integer-cent, left as-is. FRONTEND_LANE_MASTER §OUTSTANDING records the parked UI backlog. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d ∝ open period
Additive kernel v8→v9 (build/erp/kernel_ops.js): kernel_checkpoints table +
closePeriod(db,{balances}) (signs head|at_op_id|balances_digest) + latestCheckpoint
+ opt-in verifyChain(db,{fromCheckpoint}). Default verifyChain UNCHANGED.
Closes the I-D residual: full verifyChain walked the whole log from GENESIS every
call (∝ total history). Bounded verify now starts at the latest signed checkpoint
(∝ open period). Grounded in ERP.md §18.9 + HolyGrail.md §1 (balance brought forward).
Witness scripts/poc_checkpoint.js → §CHECKPOINT PASS (9/9). MEASURED I-D win:
full verify 24→93ms over 4 periods (grows); bounded 25→23ms (FLAT, 4× @period4).
C2 open-period tamper still caught; C3 signed head == sealed close tip + cold tamper
proven by full verify (bounded trusts the signed anchor — stated trade); C4 forged
anchor rejected; C5 deterministic; C6 default path unchanged. All 5 guardrail
witnesses GREEN (additive, no regression).
NON-INVENT: kernel only anchors+signs caller-supplied balances, never computes them.
Mirror drift flagged (site v6/deploy/dev v4 vs build/erp v9) — pre-existing, GO-gated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/probe_localhost_v9.js — loads the served glassbowl ERP (site/ @ :8848, coherent build/erp v9 publish) in real Chromium and confirms: 0 pageerrors, kernel v9+W-CHECKPOINT served/loaded, §I-D (closePeriod/latestCheckpoint) + §I-K (commitGroup) primitives exported, the iDempiere spine UI renders (481 SVG nodes, 6 workflows), an in-browser period-close checkpoint round-trips (bounded verify scans only from the checkpoint), and the mobile UI reveals its touch-only #diagBtn on a ≤760px viewport. §PROBE PASS. Wiring/deploy check (§-log first per CLAUDE.md), not a value witness — correctness is poc_checkpoint.js. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…PEC §4) + idempiere localhost probe
§4 "After the receipt" names a forgotten thread: today the receipt is view-only
(report_overlay.js, close ✕ only — no print/share/save/email/persist). Separates the
TWO concerns the gap conflated:
4.1 OUTPUT/DELIVERY (human) — Print/Share/Save-PDF via window.print + navigator.share
(edge/OS, server-free; SocialPlatformLens:64) + channel deliver (GuaranteedChannels).
Tasks R4 §RPT-OUT, R5 §RPT-SEND. Receipt is a projection → re-fold from the op (log-first).
4.2 CONSEQUENCE/POSTING (ledger) — Complete's ship/invoice/Dr-AR/Cr-Rev is DELEGATED
install-side (§I-K / §13.6); commitProcess flips status only → "Completed" ≠ books moved.
4.3 open lifecycle: CL/Void/Reverse/archive + multi-doc chaining named, not built.
probe_idempiere_v9.js — localhost wiring smoke for the REAL renderer (bim-ootb/erp/
idempiere.html) on the v9 kernel: §IPROBE PASS — boots clean, login→role-scoped chrome
renders (GardenWorld, 2789 menu nodes), commitOp write path works on v9 (no regression),
bounded checkpoint round-trips, mobile clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
red1oon
added a commit
that referenced
this pull request
Jun 10, 2026
…lows oracle-diff closed - foldStatement now oracle-equivalent for ALL 3 PA_Reports: 102 Cash Flows maxDiff=0c (140 seg cells, non-vacuous) in both witnesses (engine + bundle-alone) - NEW pure verb foldPrint: recursive 'P' master-detail + PrintDataGroup row engine (sort/group/sum/count/avg, one BigDecimal pass) — replaces DataEngine+PrintDataGroup; renderPrint DOM replaces LayoutEngine/Jasper - W-PRINTFORMAT GREEN: format 120 Invoice Header -> 'P' -> 121 Invoice LineTax, 8/8 seed invoices, 48 cells maxDiff=0c vs live base tables + stored grandtotal; falsifiers drop-P / +1c-mis-sum / drop-link all fire (PrintData TREE, not pixels) - NEW scripts/extract_printformat.sh: ad_printformat(93)+items(2780)+materialized print views into the bundle (PG evaluates the view SQL — never reimplemented) - Browser: data-gated "iDempiere format" print button + Trial Balance menu leaf (502 -> foldTrialBalance); Statement of Accounts (350) named-deferred - poc_pa_report.js re-pointed at the bundle (ad_full.db concurrently clobbered) - Docs: ReportingFold EXECUTED + as-built 4b/4c; matrix PA_Report/AD_PrintFormat rows oracle-equivalent (headless ceiling); paper GAP #8 narrowed to its tail Co-Authored-By: Claude Fable 5 <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.
Browser write-path engine work under the delegate-to-install spine decision (
prompts/ENGINE_FULL_ERP_ISSUES.md §0.0).What landed
commitGroup(N ops, ONE group hash, all-or-none, sealed once from the tip → also flattens the I-D O(n²) per-op reseal). UIcommitProcesscommits the doc action viacommitGroup. Consequence ops (ship/invoice/postings) are a NON-INVENT, clearly-marked DELEGATED extension point (install-side I-C/I-G) — never fabricated in the browser.assertRateAsInputguard wired intocommitGroup: a conversion-bearing op MUST carryrate/rateDate/rateSourceor the whole group rejects (multi-currency disabled until rate-as-input).bigdecimal.jsloaded inglassbowl.htmlbefore the kernel; the I-J conversion math uses exactBigDecimal, never raw JS float.Verification (all re-run independently)
poc_opgroup,poc_crud_group,poc_rate_input,poc_chain,poc_kernel.bench_oplog_pg) — honest storage-only scope, no over-claim (mature PG is faster at the raw primitive; the browser edge is locality, not speed).site/is the gitignored publish mirror ofbuild/erp/(tracked source). Kernel bumped to v8.🤖 Generated with Claude Code