CHUNKED CONTEXT PACKAGE
DELIVERY INSTRUCTIONS
- Send each chunk below as ONE message, in order, starting with Chunk 1.
- Wait for the model's acknowledgement ("Received chunk i of 4") before sending the next chunk.
- Do not edit the chunk contents — the markers and the content are designed to travel together.
CHUNK STRATEGY
- Content: 25,168 characters, ~6,992–8,989 tokens (Code).
- Target model: Claude Sonnet (200,000-token window; verified June 2026).
- Chunk budget: ~4,000 tokens (11,200 characters max per chunk) → 4 chunks.
- Delivery mode: AI Reading Mode — Strict reading mode — the model is told to wait for every part and is forbidden from early analysis.
- Boundary quality: 3 section breaks, 0 paragraph breaks, 0 line-level breaks, 0 hard cuts.
===== CHUNK 1 of 4 =====
- This content arrives in 4 parts. The parts form ONE continuous document, in order.
- Do NOT respond, summarize, or analyze yet — not after this part, and not after any part except the final one.
- Wait until the final part explicitly announces that all chunks are delivered.
- After reading, reply ONLY: "Received chunk 1 of 4." Then wait for the next chunk.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
----- END OF CHUNK 1 of 4 — do not respond yet; chunk 2 follows -----
===== CHUNK 2 of 4 =====
- Chunk 2 of 4 — part of the same continuous content. The earlier rules still apply.
- After reading, reply ONLY: "Received chunk 2 of 4." Then wait for the next chunk.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
----- END OF CHUNK 2 of 4 — do not respond yet; chunk 3 follows -----
===== CHUNK 3 of 4 =====
- Chunk 3 of 4 — part of the same continuous content. The earlier rules still apply.
- After reading, reply ONLY: "Received chunk 3 of 4." Then wait for the next chunk.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
----- END OF CHUNK 3 of 4 — do not respond yet; chunk 4 follows -----
===== CHUNK 4 of 4 =====
- Chunk 4 of 4 — part of the same continuous content. The earlier rules still apply.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
### File: src/billing/proration.js
```
export function prorate(plan, daysUsed, daysInCycle) {
const daily = plan.priceCents / daysInCycle;
const used = Math.round(daily * daysUsed);
return { usedCents: used, creditCents: plan.priceCents - used };
}
```
The proration helper assumes calendar billing cycles; anniversary cycles are normalized upstream before this function is called.
### File: src/billing/invoice.js
```
export function buildInvoice(account, items, credits) {
const subtotal = items.reduce((s, i) => s + i.amountCents, 0);
const credit = credits.reduce((s, c) => s + c.amountCents, 0);
return { accountId: account.id, totalCents: Math.max(subtotal - credit, 0), lineCount: items.length };
}
```
Invoices clamp at zero; negative balances roll into the credit ledger rather than producing negative invoices.
===== ALL 4 CHUNKS DELIVERED =====
- All 4 chunks are delivered — the waiting rule ends now.
- Respond using the COMPLETE content across all chunks; do not answer from the final chunk alone.
TASK
[Describe what the AI should do with the full content]
NOTE
- Chunk budgets use character-based token estimates, not tokenizer output; model windows verified June 2026.