Specification · gl @ 0.1

gl — Closing the Books · Area Specification

last conformance run: 4/4 scenarios pass · 8 acts mapped 2026-10-24 19:48 UTC

Spec

Status: 0.1. The month-end close: a checklist of what stands between a period and its close, adjusting entries (accruals that reverse, depreciation, corrections), closing a period so its figures stop moving, and corrections for whatever later changes it. The step from handing a journal to someone else's ledger towards carrying the ledger itself.

1. Calibration: who this is for

A small business and its accountant, closing monthly or quarterly. The accountant wants the numbers they reported for September to still be September's numbers in December, and anything that changed since to show up as a change, not as a silent rewrite. The owner wants to know what is left to do before the month can close.

2. Scope

In: the close checklist, adjusting entries (with optional reversal on the first day of the next month), closing a period, reopening the latest close, and corrections in the first open period.

Out (§9): a fixed asset register and depreciation schedules, recurring entries, budgets, consolidation, year-end retained earnings roll-forward, tax filings.

3. Entities and lifecycles

4. The acts

Writes: record_entry, void_entry, close_period (a person's act), reopen_period (a person's act).

Reads: checklist (what blocks a close through a date, and what is open but not blocking), entries, closes, changes (the corrections, per account, since each close).

5. Invariants

6. Required read models

checklist (blocking and open items, each with what to do), entries, closes (through, by whom, totals, hash, and whether the record has changed since), changes (per account, with the closes they correct).

7. Contract vs freedom

Contract: closing as a person's act; frozen closed periods; corrections on the first open day; balanced, reasoned adjusting entries. Freedom: how often to close, the account words.

8. Conformance (scenarios)

01 an adjusting entry posts and a reversing accrual reverses on the first of next month · 02 an unbalanced entry and an entry dated in a closed period are refused · 03 the agent cannot close or reopen · 04 the checklist blocks a close while statement rows are not reviewed. The person's close, the frozen period and the correction for a late change are contract gate 19, because scenarios run as an agent.

9. Deferred, with reasons

ItemWhy deferred, not rejected
Fixed asset register, depreciation schedulesDepreciation is an adjusting entry today; a register with methods and lives is its own area.
Recurring entriesRecord each month's entry; a schedule waits for a design partner's pattern.
Year-end roll-forwardEarnings to date carry on the balance sheet; closing the year into retained earnings comes with year-end.
Budgets, consolidationPlanning and groups of companies; not this calibration.
Tax filingsThe accountant files; Saybooks gives them closed, tied numbers.

---

Change log: 0.1 (2026-10-24) — first version: checklist, adjusting entries with reversal, closing and reopening, corrections on the first open day.

Acts

ActKindRequired
record_entrywritedate memo lines reason
void_entrywriteentry reason
close_periodwritethrough reason
reopen_periodwritereason
checklistreadthrough
entriesreadnone
closesreadnone
changesreadnone

Invariants

IdInvariant
GL-1Money is integer cents; every entry balances, adjusting entries included.
GL-2Closing and reopening are a person's acts, with a reason, refused to an agent whatever its role.
GL-3A closed period's journal is what it was at close; its financials and hand-overs never change afterwards.
GL-4A later change to a closed period lands as a correction on the first open day, per account, named.
GL-5Adjusting entries are dated in an open period, balance, carry a reason and say each account's kind.
GL-6An accrual marked to reverse reverses itself on the first day of the next month.
GL-7A close is refused while statement rows in the period are unreviewed or an account does not tie; the rest is listed.
GL-8Only the latest close can be reopened.
GL-9Every write is a logged command with an actor; refusals are logged too.

Scenarios

Each scenario is a file of acts with expected outcomes. ok means the act must succeed with the listed fields; refused means the act must be refused with a sentence containing the listed text. Refusals are contract.

adjusting entries, and an accrual that reverses pass

GL-1/5/6: an accrual dated the last day of April reverses on the 1st of May; depreciation posts as given; a voided entry stays on the record.
#ActExpectWhy
1record_entryok status="posted" reverse_on="2099-05-01" total=12940
2record_entryok reverse_on=null total=12500
3entriesok count=2
4void_entryok status="voided"
5void_entryrefused already voided

an entry must balance and say what kind each account is pass

GL-1/5: unbalanced, two-sided and kindless lines are refused with what is wrong; an entry needs a reason.
#ActExpectWhy
1record_entryrefused does not balance
2record_entryrefused one of them
3record_entryrefused kind is one of
4record_entryrefused at least two lines

the agent cannot close or reopen the books pass

GL-2: closing and reopening are a person's acts, whatever the agent's role; the refusals are logged.
#ActExpectWhy
1close_periodrefused person's act
2reopen_periodrefused person's act
3closesok count=0 closed_through=null

the checklist blocks a close while a row is not reviewed pass

GL-7: an unreviewed statement row in the period blocks the close; once reviewed, the account ties and nothing blocks.
Environment: import_statement
#ActExpectWhy
1checklistok ready=false
2review_transactionok
3checklistok ready=true

These pages are generated from the files in specs/ in the repository; scenarios are executed by src/conformance.js on every build. Written and maintained by Peter Varga, who also runs Portland AI Works. github.com/alviso/saybooks, AGPL-3.0.