Skip to content

Construct each class inside it; make PolicyCheck only by checking - #1

Merged
tjpalmer merged 1 commit into
mainfrom
construct-in-class
Nov 24, 2026
Merged

tjpalmer merged 1 commit into
mainfrom
construct-in-class

Conversation

@tjpalmer

Copy link
Copy Markdown
Collaborator
  • Url makes every Url (private ofRecord/applyOverride); Url.parse parses directly, and Url.check and Url.parseSource hold checkUrl's and parseUrlSource's bodies; Host.parse gives a parsed Host or null
  • PolicyCheck.check(policy, input) does the checking, which UrlPolicy.check calls, so only a check makes a PolicyCheck; UrlPolicy's rules read back as public read-only properties
  • UrlCheck, ValidationError, UrlSource, and SourceSpan: plain records with public constructors
  • Exported functions unchanged; tests that a check comes only from checking, rules read back, and plain records

- Url makes every Url (private ofRecord/applyOverride); Url.parse
  parses directly, and Url.check and Url.parseSource hold checkUrl's
  and parseUrlSource's bodies; Host.parse gives a parsed Host or null
- PolicyCheck.check(policy, input) does the checking, which
  UrlPolicy.check calls, so only a check makes a PolicyCheck; UrlPolicy's
  rules read back as public read-only properties
- UrlCheck, ValidationError, UrlSource, and SourceSpan: plain records
  with public constructors
- Exported functions unchanged; tests that a check comes only from
  checking, rules read back, and plain records

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tom <tom@temper.systems>
@tjpalmer
tjpalmer merged commit 201f361 into main Nov 24, 2026
12 checks passed
@tjpalmer
tjpalmer deleted the construct-in-class branch November 24, 2026 18:58
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