Conversation
- refactor helper APIs to use options objects instead of >3 positional args - update call sites to match new helper signatures - document bug-fix and argument-count guidance in CONTRIBUTING
- reject negative or non-bigint amounts - add regression test for negative withdraw
- fail makeEmptyPurse when GUID already exists - add regression test for GUID collision attack
- move attack tests into dedicated file - assert commodity GUID collisions are rejected - fix createIssuerKit to fail on existing commodity
- reject withdraw amounts with mismatched brands - reject openAccountPurse for wrong commodity - add adversarial tests for both cases
- model payments as hold txs retargeted on deposit - assert single-tx split behavior and holding guard - document hold decision in IBIS
- store check numbers in transactions and payment records - add payments facet with getCheckNumber/openPayment - test payment reification across reopen
- add chart facet for placing purse accounts - add serial community chart test with statements - document flow B and periodic minting TODOs
Add a minimal escrow layer that records a single transaction with holding splits, optional description text, and unique check number enforcement, plus a unit test that swaps two purses via the holding account. Expose escrow from the package entry point and types; extend the chart facet with placeAccount plus placeholder support so non-purse accounts can be arranged in the tree. Expose mint info (holding/recovery GUIDs), rename the holding account to “Mint Holding,” ensure mint recovery is a STOCK account, and allow account creation helpers to accept parent GUIDs. Rework the community story to use escrow awards, variable issue values and varied issue-style descriptions; expand to 7 members across 3 weeks; create Mint as a root-level placeholder with holding/recovery under it; switch the chart subtree to STOCK accounts; and exclude the holding account from statement totals. Store transaction dates as full timestamps using datetime(date(...)) so GnuCash parses them consistently. Tests: npm run check (in packages/ertp-ledgerguise)
Owner
Author
|
progress:
2026-01-18 17:14 a245f27 feat(ertp-ledgerguise): add escrow layer and mint charting |
Thread a Zone through issuer/escrow/chart/purse entry points so all facets are created via exo(). Add a default zone with method freezing and widen freezeProps to handle symbol keys. Track live payments and emit a Symbol.dispose warning for leaked live payments. Update types to accept zone parameters.
Switch clerk to pass a zone that wraps facets in RpcTarget prototype methods. Normalize amount-like args for RPC and keep GUIDs collision-resistant. Add patch-package and a capnweb patch to preserve export identity on import. Expand the smoke test to mint and transfer 10 BUCKS over WebSocket RPC. Document the capnweb identity patch and add TODOs for migrations and RPC batching.
Describe the bootstrap console flow and /api Cap'n Web endpoint.
- Core Principles: inject first (ambient authority under it), then encapsulation - Encapsulation section: freezing, zone pattern, actors (encapsulated state) - Increased Cooperation with Limited Vulnerability: capability-based security - Sealer/unsealer as key attenuation pattern with public-key analogy - Move sync/async DB IBIS to escrow-accounting.md - Add escrow account identification section to escrow-accounting.md - Document actor encapsulation pattern in escrow-db.test.ts JSDoc - Add JSDoc convention guidance to CONTRIBUTING.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create test/mock-io.ts with: - makeTestClock: deterministic clock advancing by fixed step - mockMakeGuid: sequential hex GUID generator - makeTestDb: in-memory GnuCash database setup Remove test/helpers/clock.ts and update imports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Chart placement now accepts sealed tokens instead of raw purses,
preventing authority leakage. The bookkeeper who places accounts
doesn't need withdrawal capability.
API changes:
- ChartFacet.placePurse({ sealedPurse, ... }) replaces ({ purse, ... })
- makeChartFacet takes getGuidFromSealed instead of getPurseGuid
- IssuerKitWithPurseGuids adds sealer and purses.getGuidFromSealed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply POLA pattern to the escrow exchange test:
- Add makeParty factory: purses are private, only deposit facets
and sealed tokens exposed
- Add makeEscrowHolder factory for escrow's encapsulated purses
- Use object patterns: parties = { alice, bob }, charts = { moola, stock }
- DRY kit creation with makeKit(mnemonic) helper
- Use makeTestDb() for database setup
Parties return sealed tokens for chart placement - they don't need
chart authority. Settlement happens through deposit facets.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
simplify verbose ReturnType patterns
Replace .join(' ') and .join('\n') patterns with template literals
for better readability. SQL queries and snapshot prose are now
multi-line strings instead of array concatenations.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Parties use async run(offer) with Promise<Payment> resolver pattern - Escrow awaits payments via Promise.withResolvers, deposits, settles - Coordination facet (getCoordination) exposes void promises for observability - Separate moolaDeposited/stockDeposited from moolaPayment/stockPayment to avoid leaking Payment authority - No data properties mixed with methods (ocap discipline) - Document "closely held vs widely shared" in ocap-discipline.md - Snapshots show AMIX state machine: Agreement → Funding → Settlement Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline makeEscrowHolder with makeErtpEscrow from escrow-ertp. Party.offer() builds EscrowParty for escrow-ertp. Add withCoordination utility for test observability. Fix Sealer type in types.ts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show only reconcile_state='n' splits to match prose about hold splits. Previously showed all splits including earlier mint/deposit. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detect columns where all values match /^-?\d+$/ and use padStart instead of padEnd for cleaner table alignment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CommodityNamespace type ('CURRENCY' | 'COMMODITY')
- SettlementFacet folds ERTP's separate transactions into one
GnuCash stock-trade transaction with proper value/quantity
- Derives exchange rate from transaction amounts
- Sanity check ensures no live payments during consolidation
- Custom description support for settlements
- Test fixture: currency-moola-test.sql (verified in GnuCash GUI)
GnuCash accepts non-ISO currencies (namespace='CURRENCY') for
transaction valuation, enabling single-transaction commodity swaps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Promote SettlementFacet to src/settlement.ts (was inline in test) - Extract gnucash-tools.ts with table types and snapshot helpers - Deprecate escrow.ts more strongly (@deprecated JSDoc) - Update README with documentation section - Update CONTRIBUTING.md status (mark completed items) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove deprecated makeEscrow/EscrowFacet exports from index.ts. community.test.ts now imports directly from escrow.ts. Co-Authored-By: Claude Opus 4.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.

GnuCash is an accounting program; a bit like Quicken but based more on traditional double-entry accounting.
ERTP is a flexible Electronic Rights protocol.
ERTP is flexible enough that we can implement it on top of a GnuCash database.
The prototype now maps ERTP‑style token awards into a real GnuCash ledger with named community member accounts, includes explicit authority boundaries (capability‑style access) and recovery mechanisms for in‑flight payments, and adds adversarial tests to ensure predictable, reversible behavior while keeping room for human‑in‑the‑loop governance decisions.