Repository navigation
docs: the harness class Tenant becomes Account, and the harness gains Receipts and Refunds - #112
Merged
Merged
Conversation
… 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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The harness declares the class
App.Tenant, and the spec uses the namespaceApp.Tenant.Storein sections 23, 27 and 28. Section 23 says a class cannot share its full name with a namespace. mago-sharp now refuses it: "App.Tenantis both a class and a namespace: rename the class or the folder." Section 28'smodule-lawand section 27'sone-type-per-filehit it.module-law's law also callsReceipts.refundableandRefunds.remaining, which no file declares.Solution
Counts on master 6629826, in
docs/spec.md,README.mdandsharp/harness/:docs/spec.mdREADME.mdTenantInactiveTenant), 14.1 and 16app/Tenant.sharp,app/Exceptions.phpApp.Tenantapp/Tenant/Store/TenantbecomesAccount;InactiveTenantbecomesInactiveAccount;tenantlocal or parameter becomesaccount.README.mdor the harness used the nameAccountbefore.app/Tenant/Store/Receipts.sharpandRefunds.sharp, one static class each, with the pure methods the law calls. Both givepaid - refunded, so the law holds.No entry joins or leaves
sharp/baseline/spec.module-lawstays listed, because the pinned Mago 625c278 can't parse themoduleblock.