Run artifact

evidence/prompts/20261020.192005.561Z_layerstesting_plan_codex.prompt.md

<pblock label="Plan artifact repair" kind="repair">

Plan Artifact Repair

Drydock accepted the Plan response shape but rejected the emitted Blueprint artifact(s) below. Repair only the deterministic defect. Preserve all unrelated content, contracts, headings, decisions, and acceptance assertions byte-for-byte where possible. Do not remove or weaken a valid assertion while adding a missing one. Every artifact with a programmatic surface retains at least two concrete Python acceptance assertions. Every DECISIONS.json is the sole decision disclosure surface; do not emit Markdown question sections.

Emit each artifact below in exactly this form, and emit no other text:

=== BEGIN ARTIFACT <FILENAME> === <the complete file body> === END ARTIFACT ===

The filename appears once, in the opening delimiter. The closing delimiter is the constant token above and never carries a name.

Emit exactly one such block for each of: DATABASE.md.

Repair pass: 1

Deterministic validation defect: DATABASE.md [## Access Patterns]: DATABASE.md: FEATURE-DB-001 has invalid repository operation 'schema.initialize': it names one declared table and one verb as <table>.<verb>, lowercase, where the verb is one of get, list, create, update, delete

Every | Owner | names one of these Features, exactly as written, or DATABASE.md for a pattern no single Feature owns — a log or other surface several Features reach, which any Blueprint may then cite. There are no other legal values: a Screen, a service, a module, and a file not on this list are each a defect.

Normative Compass sections. They bind every assertion you write or retain, including one you add to satisfy the defect above.

Constraints

Guardrails

database only through ledger load.

Verification Protocol

Story kindCommandAsserts
Every behavioral storysh bin/test.shexit 0
Terminal story (once, last)sh sources/run.shexit 0

<!-- drydock:build-write-guardrail:start -->

Original DATABASE.md, in the same form your reply must use: === BEGIN ARTIFACT DATABASE.md ===

DATABASE: Ledger Persistence

FieldValue
Version20261020 V1
DescriptionDefine the relational ledger schema and typed persistence operations.
Depends OnARCHITECTURE.md
Providesaccounts table, categories table, transactions table, schema initialization
Consumes—

Questions

Stores

The application uses the relational database selected by DATABASE_URL, then DATABASE_PATH, then data/app.db. SQLite paths may be prefixed with sqlite://; PostgreSQL DSNs begin with postgres:// or postgresql://. Application callers use only persistence.open_database.

Access Patterns

FEATURE-DB-001 — Initialize schema

FieldValue
OwnerDATABASE.md
Accesswrite
Repository operationschema.initialize
Compatibilityrebuild

Input: InitializeSchema

FieldType
drop_existingINTEGER

Output: SchemaStatus

FieldType
tablesTEXT

FEATURE-DB-002 — Account operations

FieldValue
OwnerFEATURE-Account-Category-Loading.md
Accessread-write
Repository operationaccounts.create
Compatibilityunchanged

Input: AccountInput

FieldType
accountVARCHAR(12)
nameVARCHAR(40)

Output: AccountRow

FieldType
accountVARCHAR(12)
nameVARCHAR(40)

FEATURE-DB-003 — Category operations

FieldValue
OwnerFEATURE-Account-Category-Loading.md
Accessread-write
Repository operationcategories.create
Compatibilityunchanged

Input: CategoryInput

FieldType
categoryVARCHAR(12)
descriptionVARCHAR(40)

Output: CategoryRow

FieldType
categoryVARCHAR(12)
descriptionVARCHAR(40)

FEATURE-DB-004 — Transaction operations

FieldValue
OwnerFEATURE-Transaction-Loading.md
Accessread-write
Repository operationtransactions.create
Compatibilityunchanged

Input: TransactionInput

FieldType
txn_idINTEGER
dateVARCHAR(10)
accountVARCHAR(12)
categoryVARCHAR(12)
amountINTEGER
memoVARCHAR(60)

Output: TransactionRow

FieldType
txn_idINTEGER
dateVARCHAR(10)
accountVARCHAR(12)
categoryVARCHAR(12)
amountINTEGER
memoVARCHAR(60)

FEATURE-DB-005 — Account reads and mutations

FieldValue
OwnerFEATURE-Account-Management.md
Accessread-write
Repository operationaccounts.get
Compatibilityunchanged

Input: AccountLookup

FieldType
accountVARCHAR(12)

Output: AccountBalanceRow

FieldType
accountVARCHAR(12)
nameVARCHAR(40)
transactionsINTEGER
balanceINTEGER

FEATURE-DB-006 — Transaction reads and mutations

FieldValue
OwnerFEATURE-Transaction-Management.md
Accessread-write
Repository operationtransactions.get
Compatibilityunchanged

Input: TransactionLookup

FieldType
txn_idINTEGER

Output: TransactionRow

FieldType
txn_idINTEGER
dateVARCHAR(10)
accountVARCHAR(12)
categoryVARCHAR(12)
amountINTEGER
memoVARCHAR(60)

FEATURE-DB-007 — Report reads

FieldValue
OwnerDATABASE.md
Accessread
Repository operationaccounts.list
Compatibilityunchanged

Input: ReportQuery

FieldType
reportTEXT

Output: ReportRow

FieldType
valuesTEXT

Schema

accounts

FieldTypeNotes
accountVARCHAR(12) PK NOT NULLAccount code
nameVARCHAR(40) NOT NULLAccount name

categories

FieldTypeNotes
categoryVARCHAR(12) PK NOT NULLCategory code
descriptionVARCHAR(40) NOT NULLCategory description

transactions

FieldTypeNotes
txn_idINTEGER PK NOT NULLTransaction identifier
dateVARCHAR(10) NOT NULLCalendar date in YYYY-MM-DD form
accountVARCHAR(12) NOT NULL REFERENCES accounts(account)Account code
categoryVARCHAR(12) NOT NULL REFERENCES categories(category)Category code
amountINTEGER NOT NULLInteger cents
memoVARCHAR(60) NOT NULLTransaction memo

Atomicity and Invariants

Schema initialization drops and recreates all three tables. Foreign keys are enforced. Every command validates all inputs and prospective balance effects before its first write. Transactions are committed atomically.

Programmatic Acceptance

User Acceptance

Guardrails

=== END ARTIFACT === </pblock>