Skip to content

docs: finance/books/ledger boundary contracts + proposals#119

Open
chitcommit wants to merge 6 commits into
mainfrom
goal/finance-books-ledger-substrate
Open

docs: finance/books/ledger boundary contracts + proposals#119
chitcommit wants to merge 6 commits into
mainfrom
goal/finance-books-ledger-substrate

Conversation

@chitcommit
Copy link
Copy Markdown
Contributor

@chitcommit chitcommit commented May 27, 2026

Summary

Docs-only branch from /goal audit of finance/books/ledger surfaces. No code or runtime changes.

Five new docs:

  • docs/contracts/chittybooks-chittyfinance.md — engine/UI boundary, source-of-truth table, API surface, deploy decision (retires the fake books.chitty.cc live-API assumption only; actual deploy choice stays an explicit operator gate)
  • docs/contracts/mercury-multitenant.md — tenant_id + legal_person_chittyid + Wave mapping rules. Flags critical schema gap: legal_person_chittyid is not on accounts in database/system.schema.ts
  • docs/proposals/api-v1-prefix-fix.md — resolves the /api/v1/* 404 as a non-issue (meta routes are intentionally under /api/v1, resource routes under /api/<resource>). One-sentence CLAUDE.md clarification only.
  • docs/proposals/ch1tty-connector-revision.md — names the dead CHITTYBOOKS_URL endpoint in chittycommand/docs/plans/2026-02-23-mercury-chittybooks-plan.md:168 and chittycommand/src/lib/integrations.ts:618; routes bookkeeping reads/writes through real finance.chitty.cc paths
  • docs/proposals/chittyledger-naming-plan.md — substrate (FOUNDATION/chittyledger) + Finance/Evidence projections; plan to rename CHITTYOS/chittyledger-evidence-legacy

Validation

  • All 5 markdown files parse (python3 read OK).
  • ChittyCommand financeClient verified to call /api/accounts not /api/v1/accounts → docs-only path-prefix clarification has zero consumer breakage.
  • OpenAPI spec at /api/v1/documentation enumerated: 9 paths, only /health and /api/v1/{status,metrics,documentation} under /api/v1; resource paths at /api/*.
  • SystemStorage enforces tenancy via tenant_id NOT NULL schema column + 117 tenantId references.

Followups (not in this PR)

  • PR-2 (CHITTYOS/chittycommand): lazy-disable booksClient — PR-ready, awaiting owner approval
  • ChittyBooks deploy choice (A container / B worker / C merged): explicit operator gate
  • CHITTYOS/chittyledger rename: org-owner action

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified API routing: resource endpoints under /api/, operational/meta under /api/v1/ and OpenAPI at /api/v1/documentation
    • Added service boundary and ownership contract for ChittyFinance, ChittyBooks, and ChittyLedger (read-only projection model)
    • Defined Mercury multitenant identity/isolation requirements and deploy gates
    • Updated connector guidance (CHITTYBOOKS_URL behavior, lazy client handling) and a naming/renaming plan for legacy ledger repos

Review Change Stack

Copilot AI review requested due to automatic review settings May 27, 2026 22:53
@github-actions
Copy link
Copy Markdown
Contributor

@coderabbitai review

Please evaluate:

  • Security implications
  • Credential exposure risk
  • Dependency supply chain concerns
  • Breaking API changes

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

📝 Walkthrough

Walkthrough

This PR adds architectural contracts and proposals to establish clear boundaries and integration patterns for the ChittyFinance system. It clarifies API routing conventions, documents ownership between ChittyBooks and ChittyFinance, defines Mercury tenant isolation requirements, revises the connector plan to use real services, and proposes a naming-collision resolution for ChittyLedger.

Changes

System Architecture Contracts and Proposals

Layer / File(s) Summary
API Routing Clarification
CLAUDE.md, docs/proposals/api-v1-prefix-fix.md
Resolves the /api/v1/entities 404 investigation by clarifying that /api/v1/* is reserved for operational/meta routes (status, metrics, documentation) while resource routes mount at /api/<resource> without prefix; updates CLAUDE.md with this distinction and confirms the OpenAPI spec at /api/v1/documentation as authoritative.
ChittyBooks-ChittyFinance Ownership Contract
docs/contracts/chittybooks-chittyfinance.md
Establishes the boundary: Finance owns bookkeeping data/mutations, Books is a read-only UI consuming ChittyFinance aggregators, and Ledger is the substrate with projections. Documents the verified deploy decision to retire the assumption that books.chitty.cc is live, provides DNS/repo evidence, lists operator-gated deployment options (A/B/C), and specifies follow-up actions including charter reconciliation and disabling dead client calls.
Mercury Multitenant Contract
docs/contracts/mercury-multitenant.md
Defines tenant isolation model with non-negotiable invariants: tenant_id on all records, legal_person_chittyid binding per Mercury account, and Wave business mapping via integration_account_links. Identifies current enforcement gap (legal_person_chittyid missing from accounts schema), proposes interim metadata or schema migration remediation, and adds deploy-gate checklist items for webhook-secret status and tenant_id != NULL storage-layer enforcement.
Mercury–ChittyBooks Connector Plan Revision
docs/proposals/ch1tty-connector-revision.md
Revises the connector plan to disable broken fake endpoints and route through real services (Mercury client, ChittyFinance webhooks, ChittyConnect, ChittyLedger). Specifies concrete steps: clear CHITTYBOOKS_URL, deprecate booksClient, soften registry assertions, and adds deploy gate requiring implementation sequencing after ChittyBooks deploy decision lands.
ChittyLedger Naming-Collision Resolution
docs/proposals/chittyledger-naming-plan.md
Proposes resolution of naming collision between CHITTYFOUNDATION/chittyledger (canonical substrate) and CHITTYOS/chittyledger (legacy evidence UI). Specifies target substrate+projections model with no separate hash chains, step-by-step plan including legacy repo rename, UI archival/porting to CHITTYAPPS/chittyevidence, and canon URI alignment via ChittyRegister; includes deploy gates for rename approval and schema-overlord review.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐇 I hopped through docs to make things clear,
Routes and contracts now appear.
Tenants tallied, connectors tuned,
Ledger names no longer marooned,
A cozy burrow for every fear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main objective: documentation contracts and proposals defining boundaries between ChittyFinance, ChittyBooks, and ChittyLedger subsystems.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch goal/finance-books-ledger-substrate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Docs-only PR adding boundary contracts and proposals from a goal audit of the finance/books/ledger surfaces. No runtime or schema changes. Clarifies the /api/v1 prefix convention in CLAUDE.md, retires the fake books.chitty.cc live-API assumption, flags a schema gap for legal_person_chittyid on accounts, and proposes a rename plan for the legacy CHITTYOS/chittyledger repo.

Changes:

  • Adds four new docs under docs/contracts/ and docs/proposals/ describing the engine/UI boundary, Mercury multitenant model, API prefix resolution, connector revisions, and naming plan.
  • Updates one line in CLAUDE.md to clarify resource routes (/api/<resource>) vs meta routes (/api/v1/*).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CLAUDE.md Clarifies /api/v1 is meta-only; resource routes are unprefixed.
docs/contracts/chittybooks-chittyfinance.md Defines ChittyBooks↔ChittyFinance engine/UI boundary and source-of-truth table.
docs/contracts/mercury-multitenant.md Documents tenant + Legal Person isolation; flags missing legal_person_chittyid column.
docs/proposals/api-v1-prefix-fix.md Resolves /api/v1/* 404 report as non-issue; proposes one-line CLAUDE.md note.
docs/proposals/ch1tty-connector-revision.md Proposes routing through real services and gating dead CHITTYBOOKS_URL.
docs/proposals/chittyledger-naming-plan.md Plan to rename CHITTYOS/chittyledger-evidence-legacy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@claude
Copy link
Copy Markdown

claude Bot commented May 27, 2026

Code Review — PR #119: docs: finance/books/ledger boundary contracts + proposals

Scope: Docs-only — 5 new markdown files + 1 CLAUDE.md line edit. No runtime risk.


Overview

This PR documents the architecture audit of the finance/books/ledger surfaces. The research is thorough, the evidence is cited with file paths and line numbers, and the schema gap discovery is a genuine catch. The deploy-gate checklists and "not decided here" discipline are well-executed.


Findings

Bug / Correctness

  • legal_person_chittyid schema gap confirmed accurate. I verified database/system.schema.ts:101-123 — the column is absent. metadata: jsonb('metadata') (line 112) already exists, so Path B (interim metadata) requires no schema migration — just a storage-layer read/write convention. The doc should note this: Path B has zero schema cost today.

  • chartOfAccounts.tenantId allows NULL (system.schema.ts:70 — "NULL = global default"), but mercury-multitenant.md lists only the four tables where tenant_id IS NOT NULL. COA nullability is by design for global defaults, but the "Verified OK" section should mention this explicitly to avoid a future reader assuming the constraint is universal.

Naming / Style

  • Filename typo: docs/proposals/ch1tty-connector-revision.md uses 1 instead of i. Every other file in docs/proposals/ uses standard spelling (api-v1-prefix-fix.md, chittyledger-naming-plan.md). If intentional, add a comment in the doc; if not, rename to chitty-connector-revision.md.

  • CLAUDE.md line is now a run-on sentence in an ASCII table comment. The old line was 65 chars; the new one is 178 chars. Consider splitting into two lines or trimming to the essential fact: Resource routes at /api/<resource>; meta/ops routes at /api/v1/. OpenAPI spec at /api/v1/documentation is authoritative.

Tracking / Process

  • CRITICAL blocker has no linked issue. mercury-multitenant.md flags legal_person_chittyid as a CRITICAL schema gap with a deploy-gate checkbox. Markdown checkboxes in merged files are never checked off — they are invisible to project trackers. Please open a GitHub issue for this blocker before merging so it stays on the board.

  • Cross-repo line references will rot. ch1tty-connector-revision.md cites chittycommand/src/lib/integrations.ts:618 and ...plans/2026-02-23-mercury-chittybooks-plan.md:168. Line numbers in other repos shift with every commit. Either pin to a commit SHA or reference only file paths + symbol names.

  • chittybooks-chittyfinance.md is labeled "Not canon yet — proposal for the pentad." That's fine, but the doc doesn't describe how it becomes canon. Add a one-line process hint (e.g., "Canonicalized when pentad owners approve and CHARTER.md cross-references this file") so it doesn't stay in proposal limbo indefinitely.

Minor

  • docs/proposals/api-v1-prefix-fix.md is clean and the corresponding CLAUDE.md patch is already applied in this PR — good alignment.
  • The chittyledger-naming-plan.md correctly gates everything on org-owner actions. No concerns.
  • The deploy options A/B/C in chittybooks-chittyfinance.md are well-structured; Option C (merged UI into ChittyFinance) is the clearly lowest-cost path and is called out as the default — this framing is helpful.

Summary

Category Status
Accuracy of documented facts ✅ Schema gap, API prefix, and deploy state all verified
Code/runtime risk ✅ None — docs only
CLAUDE.md change ⚠️ Line too long for ASCII table column
Filename consistency ⚠️ ch1tty typo vs rest of proposals dir
CRITICAL gap tracking ❌ Needs a GitHub issue before merge
Cross-repo line refs ⚠️ Will rot; prefer symbol names

Recommendation: Open a GitHub issue for the legal_person_chittyid blocker and fix the ch1tty filename, then this is good to merge.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/contracts/chittybooks-chittyfinance.md`:
- Line 12: The table row that lists "ChittyLedger (legacy fork)" currently
references the wrong repository identifier `CHITTYOS/chittybooks`; update that
repo string to `CHITTYOS/chittyledger` so the legacy ledger entry points to the
correct repository (look for the row containing "ChittyLedger (legacy fork)" and
replace the `CHITTYOS/chittybooks` token with `CHITTYOS/chittyledger`), and make
the same fix for the duplicate occurrence noted around the other mentioned line.

In `@docs/contracts/mercury-multitenant.md`:
- Around line 14-22: Add a language tag to the fenced diagram block that begins
with "Person (P-Legal, e.g. "IT CAN BE LLC")" so it stops triggering
markdownlint MD040; update the opening triple-backtick to include a language
identifier (e.g., ```text) for that diagram block.

In `@docs/proposals/chittyledger-naming-plan.md`:
- Around line 16-25: The fenced code block that begins with ``` has no language
identifier causing markdownlint MD040; update that opening fence to include a
language such as text (e.g., change ``` to ```text or ```plaintext) so the block
is explicitly labeled and the linter warning is resolved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aebb8db2-8511-4478-aed5-12b5c9fc1c30

📥 Commits

Reviewing files that changed from the base of the PR and between 652917a and b5a1ff2.

📒 Files selected for processing (6)
  • CLAUDE.md
  • docs/contracts/chittybooks-chittyfinance.md
  • docs/contracts/mercury-multitenant.md
  • docs/proposals/api-v1-prefix-fix.md
  • docs/proposals/ch1tty-connector-revision.md
  • docs/proposals/chittyledger-naming-plan.md

| ChittyFinance (engine) | `CHITTYAPPS/chittyfinance` | Hono on CF Workers at `finance.chitty.cc` | `200 ok` |
| ChittyBooks (UI/app) | `CHITTYAPPS/chittybooks` | Python Flask, `main.py`, Dockerfile, `.replit` → `cloudrun` | **Not deployed**. `books.chitty.cc` does not resolve. |
| ChittyLedger (substrate) | `CHITTYFOUNDATION/chittyledger` | Worker at `ledger.chitty.cc` | `200 ok` |
| ChittyLedger (legacy fork) | `CHITTYOS/chittybooks` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Incorrect legacy repo identifier for ChittyLedger.

The contract points to CHITTYOS/chittybooks, but this proposal set describes the legacy ledger collision as CHITTYOS/chittyledger. Keeping this as-is can send follow-up actions to the wrong repo.

Suggested fix
-| ChittyLedger (legacy fork) | `CHITTYOS/chittybooks` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |
+| ChittyLedger (legacy fork) | `CHITTYOS/chittyledger` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |
...
-- [ ] `CHITTYOS/chittybooks` legacy fork is renamed, archived, or repurposed as ChittyLedger-Evidence — do not let it shadow the canonical surface.
+- [ ] `CHITTYOS/chittyledger` legacy fork is renamed, archived, or repurposed as ChittyLedger-Evidence — do not let it shadow the canonical surface.

Also applies to: 84-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/contracts/chittybooks-chittyfinance.md` at line 12, The table row that
lists "ChittyLedger (legacy fork)" currently references the wrong repository
identifier `CHITTYOS/chittybooks`; update that repo string to
`CHITTYOS/chittyledger` so the legacy ledger entry points to the correct
repository (look for the row containing "ChittyLedger (legacy fork)" and replace
the `CHITTYOS/chittybooks` token with `CHITTYOS/chittyledger`), and make the
same fix for the duplicate occurrence noted around the other mentioned line.

Comment on lines +14 to +22
```
Person (P-Legal, e.g. "IT CAN BE LLC")
│ legal_person_chittyid
└── Account (Mercury account #1, #2, ...)
│ tenant_id
└── Transaction (mercury txn rows)
│ metadata.mercury_kind, mercury_id
└── Allocation → Property/Lease (Business surface)
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced diagram block.

This fenced block is missing a language identifier and triggers markdownlint MD040.

Suggested fix
-```
+```text
 Person (P-Legal, e.g. "IT CAN BE LLC")
    │  legal_person_chittyid
    └── Account (Mercury account `#1`, `#2`, ...)
           │  tenant_id
           └── Transaction (mercury txn rows)
                  │  metadata.mercury_kind, mercury_id
                  └── Allocation → Property/Lease (Business surface)
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 14-14: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/contracts/mercury-multitenant.md around lines 14 - 22, Add a language
tag to the fenced diagram block that begins with "Person (P-Legal, e.g. "IT CAN
BE LLC")" so it stops triggering markdownlint MD040; update the opening
triple-backtick to include a language identifier (e.g., ```text) for that
diagram block.


</details>

<!-- fingerprinting:phantom:triton:hawk -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +16 to +25
```
ChittyLedger (substrate) — CHITTYFOUNDATION/chittyledger — ledger.chitty.cc
├── ChittyLedger-Finance — projection (tables in substrate DB; surface via ChittyFinance)
│ schema doc: docs/chittyledger-finance-design.md (already canon)
│ writer: ChittyFinance via /entries
│ reader: ChittyFinance, ChittyBooks (read-only via ChittyFinance aggregators)
└── ChittyLedger-Evidence — projection (tables in substrate DB; surface via ChittyEvidence)
writer: ChittyTrace + ChittyEvidence via /entries
reader: ChittyCases, ChittyResolution
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language identifier to the fenced code block.

Line 16 opens a fenced block without a language, which triggers markdownlint MD040. Use text (or plaintext) to satisfy linting.

Suggested diff
-```
+```text
 ChittyLedger (substrate)        — CHITTYFOUNDATION/chittyledger    — ledger.chitty.cc
 ├── ChittyLedger-Finance        — projection (tables in substrate DB; surface via ChittyFinance)
 │       schema doc:               docs/chittyledger-finance-design.md (already canon)
 │       writer:                   ChittyFinance via /entries
 │       reader:                   ChittyFinance, ChittyBooks (read-only via ChittyFinance aggregators)
 └── ChittyLedger-Evidence       — projection (tables in substrate DB; surface via ChittyEvidence)
         writer:                   ChittyTrace + ChittyEvidence via /entries
         reader:                   ChittyCases, ChittyResolution
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 16-16: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @docs/proposals/chittyledger-naming-plan.md around lines 16 - 25, The fenced
code block that begins with has no language identifier causing markdownlint MD040; update that opening fence to include a language such as text (e.g., change to text or plaintext) so the block is explicitly labeled and
the linter warning is resolved.


</details>

<!-- fingerprinting:phantom:triton:hawk -->

<!-- This is an auto-generated comment by CodeRabbit -->

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5a1ff248b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +43
| `/api/allocations` | Allocation rules + history |
| `/api/classification` | COA assignments + audit trail |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the mounted allocation/classification endpoints

The code mounts allocation handlers only under /api/allocations/rules, /api/allocations/preview, /api/allocations/execute, and /api/allocations/runs, and classification handlers under subpaths plus /api/coa; there is no base GET/POST /api/allocations or base /api/classification handler. Because this table is labeled “verified mounted” and defines what ChittyBooks should consume, clients following it will hit 404s. Please list the actual mounted paths or explicitly mark these as prefixes.

Useful? React with 👍 / 👎.

- `GET /api/transactions?source=mercury` — Mercury txns scoped to caller's tenant
- `GET /api/transactions?source=wave` — Wave txns scoped to caller's tenant
- `GET /api/transactions?source=stripe` — Stripe charges scoped to caller's tenant
- `GET /api/reports/reconciliation?tenant_id=...&period=...` — three-way diff (Mercury ↔ Wave ↔ Stripe)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't advertise an unmounted reconciliation route

The repo does not mount /api/reports/reconciliation; server/routes/reports.ts currently exposes only GET /api/reports/consolidated under /api/reports. If ChittyBooks implements this contract for the Mercury/Wave/Stripe diff, the documented request will 404. Either add the reconciliation route before publishing this contract or point the doc at an existing endpoint.

Useful? React with 👍 / 👎.


## API Surface ChittyBooks consumes

All paths are under `https://finance.chitty.cc`. Auth: ChittyAuth Bearer token. Tenant: `X-Tenant-ID` header (server-side enforces from JWT claims; path param is not trusted).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document an auth mode the API accepts

server/middleware/auth.ts only treats an Authorization: Bearer ... header as the service token (CHITTY_AUTH_SERVICE_TOKEN); ChittyAuth JWTs are accepted via the session cookie path, not as bearer tokens. If ChittyBooks sends a ChittyAuth Bearer token as this contract specifies, protected routes will return 401 before tenant resolution. Please document service-token auth plus the required caller header, or the cookie/JWT flow that actually works.

Useful? React with 👍 / 👎.

| ChittyFinance (engine) | `CHITTYAPPS/chittyfinance` | Hono on CF Workers at `finance.chitty.cc` | `200 ok` |
| ChittyBooks (UI/app) | `CHITTYAPPS/chittybooks` | Python Flask, `main.py`, Dockerfile, `.replit` → `cloudrun` | **Not deployed**. `books.chitty.cc` does not resolve. |
| ChittyLedger (substrate) | `CHITTYFOUNDATION/chittyledger` | Worker at `ledger.chitty.cc` | `200 ok` |
| ChittyLedger (legacy fork) | `CHITTYOS/chittybooks` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point the legacy ledger row at the ledger repo

This row labels CHITTYOS/chittybooks as the legacy ChittyLedger fork, while the companion naming plan identifies CHITTYOS/chittyledger as the collision and rename target. Since the deploy gate later tells operators to rename/archive this legacy fork, following this contract could repurpose the ChittyBooks UI repo instead of the legacy ledger repo.

Useful? React with 👍 / 👎.

| Bookkeeping reads | ChittyFinance | `GET https://finance.chitty.cc/api/transactions` and `/api/reports/*` |
| Bookkeeping writes | ChittyFinance | `POST https://finance.chitty.cc/api/transactions`, `/api/allocations`, `/api/classification` — **not** a separate `chittybooks` write API |
| Credentials | ChittyConnect | `https://connect.chitty.cc` via concierge — never chat-paste |
| Ledger writes | ChittyLedger | `https://ledger.chitty.cc/entries` (auth-required) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the ledger write path Finance exercises

ChittyFinance's ledger client and its test post ledger entries to ${base}/api/entries, but this proposal tells the follow-up ChittyCommand work to write to https://ledger.chitty.cc/entries. If that connector follows this doc, its ledger writes will use a different path than the existing Finance integration and can fail against the currently exercised contract.

Useful? React with 👍 / 👎.

Comment on lines +40 to +42
- `GET /api/transactions?source=mercury` — Mercury txns scoped to caller's tenant
- `GET /api/transactions?source=wave` — Wave txns scoped to caller's tenant
- `GET /api/transactions?source=stripe` — Stripe charges scoped to caller's tenant
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't promise transaction source filters

GET /api/transactions currently reads only the optional limit query and calls storage.getTransactions(tenantId, limit), which filters by tenant but not by source. In reconciliation contexts that use ?source=mercury, ?source=wave, or ?source=stripe as documented here, the API will return the full tenant transaction feed instead of the requested source-specific set.

Useful? React with 👍 / 👎.

|---|---|---|
| Mercury read API | `https://api.mercury.com/api/v1` (direct, OAuth tokens scoped per tenant) | Token issued per `(tenant_id, legal_person_chittyid)` via ChittyConnect |
| Mercury write API | `mercury-proxy` on `chittyserv-dev` (IP-allowlisted by Mercury) | `X-Mercury-Token` per request; proxy is stateless re tenancy |
| Mercury webhooks | `/api/webhooks/mercury` on `finance.chitty.cc` | Per-business HMAC secret, resolves to `tenant_id` + `legal_person_chittyid` before write |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the native Mercury webhook URL for HMAC

The HMAC-verified Mercury receiver is mounted at POST /api/webhooks/mercury/:tenantId; the base POST /api/webhooks/mercury path is the legacy ChittyConnect-normalized receiver authenticated only by service token. Registering Mercury webhooks against the base URL as documented here will bypass the per-tenant HMAC flow and fail for native Mercury event payloads.

Useful? React with 👍 / 👎.

chitcommit added a commit that referenced this pull request May 28, 2026
* refactor(server): split routes into books vs accounting concerns

Introduce a structural books/accounting boundary with no behavior change.
Books writes facts (ingest, categorize, journal); accounting derives
meaning (chart of accounts, reporting, tax, allocations).

- move transactions/import/webhooks -> server/books/
- move accounts/reports/tax/allocations -> server/accounting/
- add concern-boundary READMEs for each tree
- classification.ts stays in routes/ (straddles both); note added
- fix import paths in app.ts and __tests__

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(deps): resolve @chittyos/schema lockfile drift

Revert PR #103's refactor that introduced an unresolvable file: dependency.

Root cause: PR #103 swapped the self-contained local scope-projector for
a thin adapter over `@chittyos/schema`, declared as
`file:../../CHITTYFOUNDATION/chittyschema`. That sibling-repo path only
exists on the dev VM. In CI it cannot resolve, and worse, pnpm 10 refuses
to record file: directory links in the lockfile importer block at all —
so `pnpm install --frozen-lockfile` always sees a specifier mismatch
("1 dependencies were added: @chittyos/schema@file:..."), failing the
Dependency Audit (High+) gate on every PR (#119, #120).

No clean dependency form resolves in CI: the package is unpublished
(npm 404), its dist/ is gitignored in the sibling repo (so a github: dep
ships no build), and it has no prepare script.

Fix: restore the pre-#103 self-contained implementation of
server/lib/central-workflows.ts (175 lines, uses @neondatabase/serverless
which is already a dependency) and drop the @chittyos/schema dependency.
Public API (scopeLog, SCOPE_TYPES, ScopeStatus, etc.) is unchanged, so
callers in workflows.ts and reports.ts are unaffected. Regenerated lockfile.

Verified in a clean checkout (sibling repo absent, pnpm 10):
  pnpm install --frozen-lockfile  -> exit 0
  pnpm audit --prod --audit-level high ... -> exit 0
  npm run check (tsc) -> exit 0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…1 prefix fix proposal

Three artifacts for /goal "ChittyFinance + ChittyBooks as finance/bookkeeping surface
over ChittyLedger". All evidence-grounded — no invented schemas, no deploys.

- docs/contracts/chittybooks-chittyfinance.md: engine/UI boundary, source-of-truth
  table, deploy decision (recommend retire chittybooks.chitty.cc, fold UI into
  ChittyFinance) with reconciled Charter/repo mismatch flagged
- docs/contracts/mercury-multitenant.md: tenant_id + legal_person_chittyid binding
  rules, Wave mapping requirement, ChittyBooks reconciliation surface, explicit
  out-of-scope for direct Mercury calls
- docs/proposals/api-v1-prefix-fix.md: finance.chitty.cc /api/v1/* 404 is a
  docs↔code mismatch (only /api/v1/documentation exists; data routes are /api/*).
  Verified ChittyCommand consumer already uses /api/* — Option 1 (fix docs) has
  zero downstream breakage.
- ch1tty-connector-revision.md: names the dead CHITTYBOOKS_URL endpoint in
  chittycommand's mercury-chittybooks plan + booksClient at integrations.ts:618,
  routes all bookkeeping reads/writes through real finance.chitty.cc paths
- chittyledger-naming-plan.md: substrate (FOUNDATION/chittyledger) +
  projections (Finance, Evidence). Plan to rename CHITTYOS/chittyledger →
  -evidence-legacy, clean nested noise, add disambiguation banners.
…d schema gap, resolve api-v1 as non-issue

- contracts/chittybooks-chittyfinance.md: DECISION (was Recommendation) with
  6-row repo-file proof table — Python+cloudrun+no wrangler+no DNS+engine already
  in chittyfinance+tenant boundary at finance schema
- contracts/mercury-multitenant.md: CRITICAL adversarial finding —
  legal_person_chittyid column absent from accounts schema; remediation paths
  A/B; tenant_id NOT NULL defense-in-depth verified OK
- proposals/api-v1-prefix-fix.md: resolved as non-issue; /api/v1/{status,
  metrics,documentation} are real meta routes (server/routes/health.ts:21,38),
  resource routes correctly at /api/<resource>. Single CLAUDE.md sentence added.
- CLAUDE.md: clarify route mount split (meta under /api/v1, resources under /api)
@chitcommit chitcommit force-pushed the goal/finance-books-ledger-substrate branch from b5a1ff2 to e15f239 Compare May 30, 2026 17:19
@github-actions
Copy link
Copy Markdown
Contributor

@coderabbitai review

Please evaluate:

  • Security implications
  • Credential exposure risk
  • Dependency supply chain concerns
  • Breaking API changes

@chitcommit chitcommit enabled auto-merge (squash) May 30, 2026 17:19
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== CLAUDE.md relevant section ==="
grep -n "api\|v1\|route\|mount" CLAUDE.md | head -30

echo "=== docs/contracts/chittybooks-chittyfinance.md ==="
cat docs/contracts/chittybooks-chittyfinance.md

echo "=== docs/contracts/mercury-multitenant.md ==="
cat docs/contracts/mercury-multitenant.md

echo "=== docs/proposals/api-v1-prefix-fix.md ==="
cat docs/proposals/api-v1-prefix-fix.md

echo "=== docs/proposals/ch1tty-connector-revision.md ==="
cat docs/proposals/ch1tty-connector-revision.md

echo "=== docs/proposals/chittyledger-naming-plan.md ==="
cat docs/proposals/chittyledger-naming-plan.md

echo "=== Check for secrets/tokens/keys in docs ==="
rg -i "(api.?key|secret|password|token|bearer|credential|private.?key|access.?key|webhook.?secret)" docs/ -n

echo "=== Check for hardcoded URLs with auth ==="
rg "https?://[^@\s]*:[^@\s]*@" docs/ -n

echo "=== Check for any package changes ==="
git diff origin/main --name-only | head -30

echo "=== Check for dependency file changes ==="
git diff origin/main -- package.json package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null | head -50

Length of output: 40420



@github-actions[bot]: This is a docs-only PR (5 markdown files + 1 CLAUDE.md line). Here is the evaluation across the four requested areas:


Security Implications

Finding Severity Source
legal_person_chittyid absent from accounts schema Critical (documented) docs/contracts/mercury-multitenant.md — PR flags this as a blocker; multi-tenant contract is partially enforced (tenant_id ✅, legal_person ❌). Neither Path A (migration) nor Path B (metadata) has landed yet.
mercury-proxy is stateless re tenancy Medium docs/contracts/mercury-multitenant.md:31 — "proxy is stateless re tenancy; tenancy is enforced by the caller (ChittyFinance) before reaching it." There is no defense-in-depth backstop at the proxy layer. A single bug in ChittyFinance's pre-call checks could allow cross-tenant Mercury writes with no secondary guard. Recommend the proxy enforce a mandatory tenant_id assertion on every inbound request, even if just a header presence check.
booksClient targeting NXDOMAIN books.chitty.cc Low docs/proposals/ch1tty-connector-revision.md — Currently harmless (DNS → NXDOMAIN). Risk: if that domain is ever registered by a third party, live requests from chittycommand could reach an uncontrolled host. The lazy-disable PR is already planned; it should be prioritized.
Internal infrastructure topology in docs Informational mercury-proxy.chitty.cc, chittyserv-dev, CF tunnel paths, and internal service URLs are enumerated in plain text. Acceptable for a private org repo, but these docs should not be published publicly.

Credential Exposure Risk

None found in the 5 new files.

  • No hardcoded tokens, secrets, or passwords in any new document.
  • No URLs with embedded credentials (user:pass@host pattern — confirmed clean by scan).
  • Docs reference only env var names (CHITTYBOOKS_URL, X-Mercury-Token, HMAC secret) — no values.
  • The credential hygiene principle is explicitly documented: "Credential rotation is owned by ChittyConnect concierge. ChittyBooks never sees a Mercury or Wave token." and "never chat-paste" — good.
  • Pre-existing test tokens (Bearer test, test-token-123) exist in older plan docs but are not introduced by this PR.

Dependency Supply Chain Concerns

None. No package.json, lockfiles, or any dependency manifests were modified. This PR is purely documentation.


Breaking API Changes

None. No source code was changed. The api-v1-prefix-fix.md proposal explicitly resolves a non-issue — the /api/v1/* (meta) vs /api/* (resources) split is intentional, pre-existing, and consistent with the OpenAPI spec. The ch1tty-connector-revision.md recommends changes to CHITTYOS/chittycommand but defers them to a follow-up PR.


Summary

This PR is safe to merge from a security standpoint with one actionable recommendation:

Before reconciliation reports go live, the legal_person_chittyid deploy gate (already flagged as a BLOCKER in docs/contracts/mercury-multitenant.md) must be resolved — either via schema migration or interim metadata — or reconciliation outputs will silently omit the Legal Person dimension.

Additionally, the mercury-proxy tenancy-stateless design warrants a follow-up hardening ticket to add a proxy-side tenant_id assertion for defense-in-depth.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@claude
Copy link
Copy Markdown

claude Bot commented May 30, 2026

Code Review — PR #119: docs: finance/books/ledger boundary contracts + proposals

Summary: Docs-only PR (267 additions, 1 deletion) that introduces 5 new contract/proposal files and a 1-line CLAUDE.md clarification. No runtime changes.


Overview

This PR does good forensic work — verifying deployed surfaces, naming collisions, and dead code paths against actual DNS/file evidence rather than assumptions. The verification methodology (citing exact file paths, line numbers, dig/curl results) is the right standard for this kind of audit.


What's Good

  • Evidence-based claims. Every assertion in the docs cites a verifiable source (file path, line number, DNS check). This is the correct standard for architecture docs.
  • Honest about partial enforcement. mercury-multitenant.md clearly flags that tenant_id is enforced at DB level but legal_person_chittyid is not — rather than papering over it.
  • Operator-gated decisions. The deploy-decision framework (Option A/B/C for ChittyBooks) correctly keeps the choice explicit rather than making it implicitly in docs.
  • CLAUDE.md change is accurate. The route-prefix clarification matches the OpenAPI evidence cited.

Issues

CRITICAL (Blocker)

mercury-multitenant.md flags a schema gap with no follow-up issue.
The doc correctly identifies that legal_person_chittyid is absent from accounts in database/system.schema.ts and marks it as a deploy blocker. But there's no linked GitHub issue, no assignee, and no milestone. A doc asserting "BLOCKER" that lives only in a docs file will be ignored — it needs to exist as a tracked issue on this repo before this merges.

Recommend: open an issue titled "schema: add legal_person_chittyid to accounts (mercury multitenant blocker)" and reference it in the doc's deploy-gates checklist.


MEDIUM

Filename typo: ch1tty-connector-revision.md (number 1 instead of letter i)

docs/proposals/ch1tty-connector-revision.md
                  ^— "1" not "i"

This breaks grep chitty, glob patterns, and is visually confusing. Rename to chitty-connector-revision.md (or chittyconnector-revision.md to match the env var naming convention).

Cross-repo line number references will go stale.
Proposals reference:

  • chittycommand/src/lib/integrations.ts:618
  • chittycommand/docs/plans/2026-02-23-mercury-chittybooks-plan.md:168

Line numbers in other repos drift immediately on the next commit. Since these are proposals (not contracts), consider citing symbols/function names instead of line numbers where possible, or add a "Verified at" date so readers know to re-verify.

CLAUDE.md route-table entry is now a paragraph, not a row.
The original table uses short phrases. The updated routes line is now 3 sentences inline — it reads awkwardly in the table context and will be truncated in most terminal widths:

# Before
routes/  22 resource-per-file modules. OpenAPI at /api/v1/documentation

# After  
routes/  22 resource-per-file modules. Resource routes are mounted at /api/<resource> (no /v1 prefix). Only operational/meta routes (status, metrics, documentation) live under /api/v1/. OpenAPI spec at /api/v1/documentation is authoritative.

The docs/proposals/api-v1-prefix-fix.md already has the full explanation. CLAUDE.md could just link to it with a shorter addition like:

routes/  22 resource-per-file modules. Resource routes at /api/<resource>; meta routes at /api/v1/*. OpenAPI at /api/v1/documentation.

LOW / Nits

  • docs/ directory is not listed under "Where Things Live" in CLAUDE.md. Given this PR is starting a docs/contracts/ + docs/proposals/ structure, a single entry (docs/ - architecture docs, contracts, proposals) would help future contributors find these.

  • chittyledger-naming-plan.md step 6 ("Canon URI alignment") references chittycanon://core/services/chitty-ledger without explaining what resolves that URI scheme or where ChittyRegister lives. If a future reader needs to act on this, they need that context.

  • chittybooks-chittyfinance.md "Source of Truth" table lists financial_documents, financial_facts, reconciliation_conflicts as written by "ChittyLedger-Finance (via ChittyTrace ingest)" — but those tables don't appear to exist in database/system.schema.ts yet (the schema gap that mercury-multitenant.md also alludes to). Consider marking these as "planned" in the table rather than implying they're present.


Security

The Mercury multitenancy model is correctly reasoned:

  • tenant_id NOT NULL + schema-level enforcement is the right defense-in-depth for cross-tenant reads.
  • The proxy/egress shim correctly identified as NOT a tenant boundary.
  • "ChittyBooks never sees a Mercury or Wave token" constraint is correctly stated and should be preserved in any deploy-gate checklist.

The legal_person_chittyid gap is the only security-relevant finding and it is correctly flagged. Until Path A or B lands, the reconciliation report MUST NOT assume the binding exists at query time.


Summary

Severity Count Addressed?
Blocker 1 (legal_person_chittyid gap needs an issue) No
Medium 3 (filename typo, stale line refs, CLAUDE.md verbosity) No
Low/nit 3 No

The underlying analysis is solid and this docs infrastructure is useful. The blocker is the missing issue tracker entry for the schema gap — docs-only blockers get lost. The filename typo should be fixed before merge. Everything else is addressable in follow-up.

Reviewed by Claude Sonnet 4.6 via Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e15f239ed8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


1. **`tenant_id` required on every Mercury-derived record.** No row, webhook event, or queue message lacks it. Cross-tenant reads are server-side blocked, not client-trusted.
2. **Legal Person ChittyID binding required.** Every Mercury account maps to exactly one Legal Person (`P-Legal` entity), recorded as `legal_person_chittyid` on the account row. Account ↔ Legal Person is many-to-one (one LLC can have many accounts).
3. **Wave business mapping required.** Each `(tenant_id, legal_person_chittyid)` pair has at most one Wave business; the mapping lives in `integration_account_links` (source = `wave`, target = `mercury`). Unmapped Mercury accounts produce reconciliation conflicts, not silent omission.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not point Wave mapping at a nonexistent table

This contract makes integration_account_links the required persistence point for the Wave↔Mercury mapping, but a repo-wide search only finds that name in this new document and database/system.schema.ts defines integrations without any link table. Until a real table/metadata field is named or added, implementers cannot satisfy the non-negotiable mapping requirement and reconciliation work will be built against a storage object that does not exist.

Useful? React with 👍 / 👎.

- `GET /api/transactions?source=wave` — Wave txns scoped to caller's tenant
- `GET /api/transactions?source=stripe` — Stripe charges scoped to caller's tenant
- `GET /api/reports/reconciliation?tenant_id=...&period=...` — three-way diff (Mercury ↔ Wave ↔ Stripe)
- `GET /api/integrations/status` — per-source connection health + last-sync timestamps
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Narrow the integration status contract

The mounted GET /api/integrations/status handler in server/routes/integrations.ts only returns per-provider configured booleans derived from environment variables; it does not read tenant integration rows or include lastSynced values. A ChittyBooks reconciliation UI following this contract will expect connection health and last-sync timestamps that the API never returns, so either the docs should describe the current shape or the endpoint should be extended before consumers depend on it.

Useful? React with 👍 / 👎.

| `/api/tenants` | List tenants the caller can read |
| `/api/properties` | Property list |
| `/api/accounts` | Account list + balances |
| `/api/transactions` | Transaction feed (filter by date, account, tenant) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not promise unsupported transaction filters

GET /api/transactions currently reads only the optional limit query before calling storage.getTransactions(tenantId, limit), so date or account filters documented here will be silently ignored and the full tenant feed will be returned. If ChittyBooks builds list views or exports around these filters, users can see unrelated transactions for the selected date/account context; either document the current query shape or add the filters before advertising them.

Useful? React with 👍 / 👎.

|---|---|---|
| Mercury read API | `https://api.mercury.com/api/v1` (direct, OAuth tokens scoped per tenant) | Token issued per `(tenant_id, legal_person_chittyid)` via ChittyConnect |
| Mercury write API | `mercury-proxy` on `chittyserv-dev` (IP-allowlisted by Mercury) | `X-Mercury-Token` per request; proxy is stateless re tenancy |
| Mercury webhooks | `/api/webhooks/mercury` on `finance.chitty.cc` | Per-business HMAC secret, resolves to `tenant_id` + `legal_person_chittyid` before write |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not claim webhooks resolve legal persons

The native Mercury webhook implementation is keyed only by :tenantId and reads webhook:mercury:secret:${tenantId}, then resolves at most a local account by Mercury account ID; it never derives or persists legal_person_chittyid. For tenants with more than one Mercury-backed legal person, this documented per-business resolution cannot happen, so downstream reconciliation would lose the legal-person binding even if the tenant is identified.

Useful? React with 👍 / 👎.


## ChittyLedger projection paths (read-only)

ChittyBooks reads ChittyLedger-Finance projection tables via `ChittyFinance` aggregator endpoints — it does not query ChittyLedger directly. This preserves the substrate boundary: ChittyLedger does not know about ChittyBooks.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Define the projection aggregator endpoints before relying on them

This says ChittyBooks reads ChittyLedger-Finance projection tables through ChittyFinance aggregator endpoints, but a route search only finds the current finance resources (/api/reports/consolidated, classification/allocation routes, MCP resources) and no mounted endpoint for financial_documents, financial_facts, or reconciliation_conflicts. A ChittyBooks UI built against this contract has no API path for the promised read-only projection data, so the contract should name existing endpoints or gate this section until the aggregators are implemented.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
docs/contracts/chittybooks-chittyfinance.md (1)

12-12: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Incorrect legacy repo identifier for ChittyLedger.

The contract points to CHITTYOS/chittybooks, but based on the chittyledger naming plan in this proposal set, the legacy ledger collision is CHITTYOS/chittyledger.

Suggested fix
-| ChittyLedger (legacy fork) | `CHITTYOS/chittybooks` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |
+| ChittyLedger (legacy fork) | `CHITTYOS/chittyledger` | Express + React, in-memory, not deployed | n/a — DUPLICATE, candidate for retirement or repurpose as ChittyLedger-Evidence seed |

Also applies to: 84-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/contracts/chittybooks-chittyfinance.md` at line 12, Update the legacy
repo identifier in the ChittyLedger table entry: replace the incorrect string
`CHITTYOS/chittybooks` with the correct identifier `CHITTYOS/chittyledger` in
the table row that currently reads "ChittyLedger (legacy fork) |
`CHITTYOS/chittybooks`"; ensure the same replacement is applied to the duplicate
occurrence noted (also at the second location mentioned).
docs/proposals/chittyledger-naming-plan.md (1)

16-25: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language identifier to the fenced code block.

The fenced code block is missing a language identifier, which triggers markdownlint MD040. Add text or plaintext to the opening fence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/proposals/chittyledger-naming-plan.md` around lines 16 - 25, The fenced
code block containing the ChittyLedger tree should include a language identifier
to satisfy markdownlint MD040; update the opening fence (the line starting with
```) to include a language token such as "text" or "plaintext" so it reads
```text (or ```plaintext) above the ChittyLedger block to silence the linter.
🧹 Nitpick comments (1)
docs/proposals/api-v1-prefix-fix.md (1)

21-21: ⚡ Quick win

Capitalize "GitHub" for correctness.

The proper capitalization is "GitHub" with a capital "H".

📝 Proposed fix
-- All 5 in-repo references to `/api/v1` (`.github/workflows/register.yml`, `deploy/registration/chittyfinance.registration.json`, `client/src/pages/Landing.tsx:342`, `.claude/commands/quick-deploy.md:28`, plans) point at real endpoints. **Nothing to fix.**
+- All 5 in-repo references to `/api/v1` (`.GitHub/workflows/register.yml`, `deploy/registration/chittyfinance.registration.json`, `client/src/pages/Landing.tsx:342`, `.claude/commands/quick-deploy.md:28`, plans) point at real endpoints. **Nothing to fix.**
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/proposals/api-v1-prefix-fix.md` at line 21, The document text "GitHub"
is not capitalized correctly; locate the sentence that reads "All 5 in-repo
references to `/api/v1` (...) point at real endpoints. **Nothing to fix.**" and
any nearby mention of "Github" or "GitHub", and update the word to the correct
capitalization "GitHub" (ensure every occurrence in this proposal line and
surrounding notes uses "GitHub").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/contracts/chittybooks-chittyfinance.md`:
- Line 12: Update the legacy repo identifier in the ChittyLedger table entry:
replace the incorrect string `CHITTYOS/chittybooks` with the correct identifier
`CHITTYOS/chittyledger` in the table row that currently reads "ChittyLedger
(legacy fork) | `CHITTYOS/chittybooks`"; ensure the same replacement is applied
to the duplicate occurrence noted (also at the second location mentioned).

In `@docs/proposals/chittyledger-naming-plan.md`:
- Around line 16-25: The fenced code block containing the ChittyLedger tree
should include a language identifier to satisfy markdownlint MD040; update the
opening fence (the line starting with ```) to include a language token such as
"text" or "plaintext" so it reads ```text (or ```plaintext) above the
ChittyLedger block to silence the linter.

---

Nitpick comments:
In `@docs/proposals/api-v1-prefix-fix.md`:
- Line 21: The document text "GitHub" is not capitalized correctly; locate the
sentence that reads "All 5 in-repo references to `/api/v1` (...) point at real
endpoints. **Nothing to fix.**" and any nearby mention of "Github" or "GitHub",
and update the word to the correct capitalization "GitHub" (ensure every
occurrence in this proposal line and surrounding notes uses "GitHub").

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3d10a2f6-50cc-42a2-9cbb-a414a8acbd92

📥 Commits

Reviewing files that changed from the base of the PR and between b5a1ff2 and e15f239.

📒 Files selected for processing (6)
  • CLAUDE.md
  • docs/contracts/chittybooks-chittyfinance.md
  • docs/contracts/mercury-multitenant.md
  • docs/proposals/api-v1-prefix-fix.md
  • docs/proposals/ch1tty-connector-revision.md
  • docs/proposals/chittyledger-naming-plan.md
✅ Files skipped from review due to trivial changes (1)
  • CLAUDE.md

chitcommit added a commit that referenced this pull request May 30, 2026
Implements step 5 of the chittyledger naming-collision plan (PR #119).
Documents ChittyFinance as the writer for the ChittyLedger-Finance
projection over the substrate at ledger.chitty.cc.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chitcommit added a commit to chittyos/chittychronicle that referenced this pull request May 30, 2026
Implements step 3 of the chittyledger naming-collision plan
(chittyapps/chittyfinance#119). The nested chittyledger/ directory was
working-tree noise from a prior submodule experiment — not an actual
submodule (no .gitmodules entry, no .git inside, tracked as plain files).

Deletes 104 stray files. No code references this path.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chitcommit added a commit to chittyfoundation/chittyscore that referenced this pull request May 30, 2026
Implements step 3 of the chittyledger naming-collision plan
(chittyapps/chittyfinance#119). The nested chittyfinance/ directory was
working-tree noise from a prior experiment — not a submodule
(no .gitmodules), not a nested git repo, tracked as plain files.

The canonical ChittyFinance repo lives at CHITTYAPPS/chittyfinance.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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