Skip to content

docs: the harness class Tenant becomes Account, and the harness gains Receipts and Refunds - #112

Merged
heyJordanParker merged 1 commit into
masterfrom
docs/harness-namespaces
Oct 12, 2026
Merged

heyJordanParker merged 1 commit into
masterfrom
docs/harness-namespaces

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

Problem

The harness declares the class App.Tenant, and the spec uses the namespace App.Tenant.Store in sections 23, 27 and 28. Section 23 says a class cannot share its full name with a namespace. mago-sharp now refuses it: "App.Tenant is both a class and a namespace: rename the class or the folder." Section 28's module-law and section 27's one-type-per-file hit it.

module-law's law also calls Receipts.refundable and Refunds.remaining, which no file declares.

Solution

Counts on master 6629826, in docs/spec.md, README.md and sharp/harness/:

Name docs/spec.md README.md Harness
The class Tenant 6 lines: sections 2, 9 (twice, plus InactiveTenant), 14.1 and 16 0 app/Tenant.sharp, app/Exceptions.php
The namespace App.Tenant 20 lines: sections 5, 23, 27, 28 and 28.1 0 none, until this PR's app/Tenant/Store/
  • The class side is used less, so it is renamed:
    • Tenant becomes Account;
    • InactiveTenant becomes InactiveAccount;
    • each tenant local or parameter becomes account.
  • Nothing in the spec, README.md or the harness used the name Account before.
  • The harness gains app/Tenant/Store/Receipts.sharp and Refunds.sharp, one static class each, with the pure methods the law calls. Both give paid - refunded, so the law holds.

No entry joins or leaves sharp/baseline/spec. module-law stays listed, because the pinned Mago 625c278 can't parse the module block.

docs/
└── spec.md                          sections 2, 9, 14.1 and 16 use Account
sharp/harness/app/
├── Account.sharp                    renamed from Tenant.sharp: public class Account
├── Exceptions.php                   InactiveTenant becomes InactiveAccount
└── Tenant/Store/
    ├── Receipts.sharp               new: Receipts.refundable(int paid, int refunded)
    └── Refunds.sharp                new: Refunds.remaining(int paid, int refunded)

… Receipts and Refunds

Problem

The harness declares the class App.Tenant, and the spec uses the namespace App.Tenant.Store in sections 23, 27 and 28. Section 23 says a class cannot share its full name with a namespace, and mago-sharp now refuses it: "`App.Tenant` is both a class and a namespace: rename the class or the folder." Section 28's module-law and section 27's one-type-per-file hit it. module-law's law also calls Receipts.refundable and Refunds.remaining, which no file declares.

Solution

- Counts on master 6629826, in docs/spec.md, README.md and sharp/harness:
  - the class Tenant: 6 lines in docs/spec.md (sections 2, 9 twice, 14.1 and 16, and InactiveTenant in section 9), and the harness files app/Tenant.sharp and app/Exceptions.php
  - the namespace App.Tenant: 20 lines in docs/spec.md (sections 5, 23, 27, 28 and 28.1), and the folder app/Tenant/Store/ the examples name
  - README.md uses neither
- The class side is used less, so it is renamed. Tenant becomes Account, InactiveTenant becomes InactiveAccount, and each tenant local or parameter becomes account. Nothing in the spec, README.md or the harness used the name Account before.
- The harness gains app/Tenant/Store/Receipts.sharp and Refunds.sharp, one static class each, with the pure methods the law calls. Both give paid - refunded, so the law holds.

No entry joins or leaves sharp/baseline/spec. module-law stays listed, because the pinned Mago 625c278 can't parse the module block.

docs/
└── spec.md                          sections 2, 9, 14.1 and 16 use Account
sharp/harness/app/
├── Account.sharp                    renamed from Tenant.sharp: public class Account
├── Exceptions.php                   InactiveTenant becomes InactiveAccount
└── Tenant/Store/
    ├── Receipts.sharp               new: Receipts.refundable(int paid, int refunded)
    └── Refunds.sharp                new: Refunds.remaining(int paid, int refunded)
@heyJordanParker
heyJordanParker merged commit b1fa0fd into master Oct 12, 2026
12 checks passed
heyJordanParker added a commit that referenced this pull request Oct 13, 2026
Master brings #111 (structs key a Map by their whole value, and
sharp/bin/spec checks its own rules) and #112 (the harness class Tenant
becomes Account, and the harness gains Receipts and Refunds). Neither
changes the engine.

The failing spec examples list keeps both sides' deletions:
- master removed §10 struct-backing-value, whose example #111 deleted
- the generics slice removed the four §9.1 constructor lines, which
  pass at the slice's pinned Mago

sharp/baseline/spec    both sides' passing examples removed
@heyJordanParker
heyJordanParker deleted the docs/harness-namespaces branch November 3, 2026 22:08
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.

1 participant