-
Notifications
You must be signed in to change notification settings - Fork 0
Add ILTP canonical transaction packet architecture spec #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chrbailey
wants to merge
1
commit into
main
Choose a base branch
from
codex/define-intermediary-lease-transaction-packet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # Intermediary Lease Transaction Packet (ILTP) | ||
|
|
||
| ## Core decision | ||
| Use a **Markdown wrapper with an embedded canonical YAML block** (`lease_packet.md`). | ||
|
|
||
| - Markdown stays human-readable for brokers, legal, and back office. | ||
| - YAML remains deterministic for validators, generators, and AI agents. | ||
| - The packet is the source of truth; Word, DocuSign, and PMS records are downstream artifacts. | ||
|
|
||
| ## System role | ||
| The ILTP is the canonical, versioned transaction-state object connecting: | ||
|
|
||
| 1. LOI intake/extraction | ||
| 2. Lease document generation (DOCX/PDF) | ||
| 3. DocuSign envelope creation and execution | ||
| 4. Yardi/AppFolio payload generation/import | ||
| 5. Audit + closeout evidence | ||
|
|
||
| ## State machine | ||
|
|
||
| ```yaml | ||
| state_machine: | ||
| states: | ||
| - loi_received | ||
| - extraction_pending | ||
| - packet_draft | ||
| - validation_failed | ||
| - backoffice_review | ||
| - legal_review_required | ||
| - ready_for_document_generation | ||
| - lease_doc_generated | ||
| - internal_approval_pending | ||
| - ready_for_docusign | ||
| - sent_for_signature | ||
| - partially_executed | ||
| - fully_executed | ||
| - pms_payload_ready | ||
| - pms_imported | ||
| - closeout_complete | ||
| - canceled | ||
| - superseded | ||
| terminal_states: | ||
| - closeout_complete | ||
| - canceled | ||
| - superseded | ||
| ``` | ||
|
|
||
| ## Canonical packet shape | ||
|
|
||
| ```yaml | ||
| packet: | ||
| packet_id: lease_2026_000142 | ||
| packet_type: commercial_small_bay_lease | ||
| status: packet_draft | ||
| version: 0.1.0 | ||
| created_at: 2026-05-13T12:00:00-07:00 | ||
| updated_at: 2026-05-13T12:00:00-07:00 | ||
| source: {} | ||
| parties: {} | ||
| property: {} | ||
| premises: {} | ||
| deal_terms: {} | ||
| economics: {} | ||
| legal_terms: {} | ||
| brokerage: {} | ||
| document_generation: {} | ||
| docusign: {} | ||
| pms_mapping: {} | ||
| exceptions: {} | ||
| approvals: {} | ||
| artifacts: {} | ||
| audit_events: [] | ||
| ``` | ||
|
|
||
| ## Architectural invariants | ||
|
|
||
| 1. Packet is canonical deal state; downstream outputs cannot drift. | ||
| 2. No DocuSign send while blocker exceptions exist. | ||
| 3. No PMS payload generation before signed lease artifact exists. | ||
| 4. Tenant legal name must reconcile across packet, lease, DocuSign, and PMS payload. | ||
| 5. Packet hash change marks generated artifacts stale. | ||
| 6. Manual overrides must emit audit events. | ||
|
|
||
| ## Validation tiers | ||
|
|
||
| - **Blockers**: required fields and preconditions for generation/sending/import. | ||
| - **Consistency**: date/order/math reconciliation checks. | ||
| - **Risk**: legal-review and approval trigger checks. | ||
|
|
||
| ## Artifact strategy | ||
| Each generated artifact stores: | ||
|
|
||
| - source packet version/hash | ||
| - generated timestamp | ||
| - template/profile id | ||
| - artifact hash | ||
| - staleness status | ||
|
|
||
| ## Mapping strategy | ||
| Use profile-driven PMS mappings rather than one hard-coded schema. | ||
|
|
||
| - `yardi_voyager_commercial_v1` | ||
| - `appfolio_commercial_v1` | ||
|
|
||
| Flow: `canonical packet fields -> mapping profile -> PMS-specific payload`. | ||
|
|
||
| ## Agent model (Software 1.0 / 2.0 / 3.0) | ||
|
|
||
| - **Software 1.0**: deterministic validation + generation code. | ||
| - **Software 2.0**: extraction/classification/search over LOIs and packet evidence. | ||
| - **Software 3.0**: natural-language operator layer for exception analysis, drafting, and patch proposals. | ||
|
|
||
| Operating pattern: | ||
|
|
||
| - AI proposes | ||
| - Validator blocks | ||
| - Human approves | ||
| - Generator emits | ||
| - Audit records | ||
|
|
||
| ## MVP implementation passes | ||
|
|
||
| 1. Packet template (`lease_packet.md`) | ||
| 2. Deterministic validator (`validate_packet.py`) | ||
| 3. Lease generation (`generate_docx.py`) | ||
| 4. DocuSign payload generation (`generate_docusign_payload.py`) | ||
| 5. PMS export (`generate_pms_payload.py`) | ||
|
|
||
| ## Recommended repository layout | ||
|
|
||
| ```text | ||
| lease-packet-engine/ | ||
| packets/ | ||
| schemas/ | ||
| templates/ | ||
| mappings/ | ||
| artifacts/ | ||
| src/ | ||
| tests/ | ||
| ``` | ||
|
|
||
| ## Executive thesis | ||
| The ILTP is not a prettier lease draft. It is a bounded-context transaction compiler IR that preserves negotiated intent, normalizes it into validated fields, generates downstream artifacts without drift, and proves what happened during audit/closeout. | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packetThe YAML example dedents at
source, making all business sections siblings ofpacketinstead of part of the canonical packet object. That structure is ambiguous for implementers and can lead validators/generators to hash or validate onlypacketmetadata while silently ignoringsource,parties, and other core fields, causing drift between tools built from this spec.Useful? React with 👍 / 👎.