Skip to content

feat(contracts): enforce approvals, auto-create renewal obligations, exposure reporting - #37

Merged
xuyushun441-sys merged 1 commit into
mainfrom
optimize/contracts
Jun 14, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
optimize/contracts

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

The charter's headline CLM capabilities weren't real: amount-tiered approval was a display-only formula (a $240k contract could be signed with zero sign-off), the promised signed → obligations flow didn't exist (AI-extracted terms produced no tasks), there was no way to record the renewal decision, extract_terms detected a currency it couldn't store, and the dashboard was missing the charter's "exposure by counterparty" report.

What changed (within caps)

  • Approval: approver + approved_at (hook-stamped) + a warning-severity validation flagging ≥$50k signed/active contracts with no approver. (Hard routed enforcement is a documented fork onto the native approval engine; warning keeps seed loads + lifecycle unblocked.)
  • signed → obligations flow: fires once on the transition into signed and creates a dated renewal-decision obligation (kind=notice, due=end_date, assigned to owner). Idempotent via previous.status.
  • Renewal loop: renewal_decision (pending/renew/renegotiate/terminate) + renewal_decision_due.
  • Currency: currency (ISO-4217) field.
  • Exposure-by-counterparty: party/contract_type dataset dimensions + an "Active Exposure by Counterparty" bar widget.

Charter

Flows cap 3→4 (ship the promised flow); LOC 2,500→3,000; reconciled the stale contract_party_link and en-only lines to reality. en + zh-CN updated.

Verification

typecheck + objectstack build + repo format:check clean. Build: 3 Objects / 44 Fields / 4 Flows.

🤖 Generated with Claude Code

…exposure reporting

Close the gap between the charter's headline CLM capabilities and what the
template actually did:

- Approval visibility/enforcement: add `approver` + `approved_at` (hook-stamped
  when an approver is recorded) and a warning-severity validation flagging any
  ≥ $50k contract that reaches signed/active without a recorded approver. (Hard
  routed enforcement stays a fork onto the native approval engine; warning
  keeps seed loads and the lifecycle unblocked.)

- signed → obligations: the charter promised this flow but it never existed, so
  AI-extracted terms produced no actionable work. New `signed_obligations.flow`
  fires once on the transition into "signed" and creates a dated renewal-decision
  obligation assigned to the owner (kind=notice, due = end_date) — turning
  post-signature metadata into a tracked task. Idempotent via previous.status.

- Renewal loop: add `renewal_decision` (pending/renew/renegotiate/terminate)
  and `renewal_decision_due` so the system records the decision, not just alerts.

- Currency: add `currency` (ISO-4217) — extract_terms already detects it but had
  nowhere to write it.

- Exposure-by-counterparty: the charter promised this report; add the `party`
  (+`contract_type`) dataset dimensions and an "Active Exposure by Counterparty"
  bar widget to the dashboard.

CHARTER: flows cap 3→4 (ship the promised signed→obligations flow), LOC cap
2,500→3,000, reconcile the stale `contract_party_link`/locale lines to reality.
en + zh-CN updated. typecheck + objectstack build + format:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys merged commit bdcb530 into main Jun 14, 2026
3 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the optimize/contracts branch June 14, 2026 23:32
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.

2 participants