Files
portal/runs/permits-2026-09-25/fixed/aggregates.yaml
T
Bendik Aagaard LynghaugandClaude Opus 5 d2aae383b2 A case can be sent back, and can end well partway along
A municipal building authority is the first sector that the line a
case walks could not describe. An application is returned for the
drawing it was missing and walks the same stretch again; an appeal
ends the moment the authority changes its own decision, without ever
reaching the board; an applicant may withdraw from anywhere, while a
refusal may only come once the papers are in.

`reached_from: { <stage>: [<stage>, ...] }` says where a stage is
entered from when the line does not. A stage named there is entered
from exactly those stages and nowhere else, so saying where a refusal
may come from also says where it may not - which `turned_down_from`
could not, being one list for every bad ending at once.

Found by replaying fifteen real building cases through portal's own
engine against a throwaway JetStream: it refused three legal paths and
accepted two illegal ones. Portal needed no change - hand-writing the
correct graph into aggregates.yaml, cycle and all, was accepted and
enforced exactly. The rebuilt site now produces that same graph from
the plan, and the access policy follows it.

Also: a public view is of a bucket, not of a need. A permit register
holds the owner's small application and the approved firm's large one
and is one page either way; the rule refused to publish a bucket the
moment any role filed into it. A bucket only a role ever writes to is
still refused.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-25 20:17:06 +02:00

654 lines
17 KiB
YAML

aggregates:
- bucket: appeals
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about the decision looked at again, by us and then by the board.
What you can do next: {site}/decide/appeal?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
reconsidered:
event: reconsidered
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Reconsidered'
body: |-
Hello,
What you sent about the decision looked at again, by us and then by the board is now we are looking at it again.
What you can do next: {site}/decide/appeal?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
changed_by_us:
event: changed_by_us
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Changed by us'
body: |-
Hello,
What you sent about the decision looked at again, by us and then by the board is now we changed our own decision.
Solveig Hauge at byggesak@vestmark.example
before_the_board:
event: before_the_board
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Before the board'
body: |-
Hello,
What you sent about the decision looked at again, by us and then by the board is now with the appeals board.
What you can do next: {site}/decide/appeal?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
upheld:
event: upheld
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Upheld'
body: |-
Hello,
What you sent about the decision looked at again, by us and then by the board is now the board kept our decision.
Solveig Hauge at byggesak@vestmark.example
overturned:
event: overturned
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Overturned'
body: |-
Hello,
What you sent about the decision looked at again, by us and then by the board is now the board overturned us.
Solveig Hauge at byggesak@vestmark.example
withdrawn:
event: withdrawn
transitions:
open:
- reconsidered
- withdrawn
reconsidered:
- changed_by_us
- before_the_board
- withdrawn
before_the_board:
- upheld
- overturned
- withdrawn
- bucket: applications
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about permission to build it, and to know where the case stands.
What you can do next: {site}/decide/small-works-application?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
incomplete:
event: incomplete
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Incomplete'
body: |-
Hello,
What you sent about permission to build it, and to know where the case stands is now papers missing.
What you can do next: {site}/decide/small-works-application?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
complete:
event: complete
on_hearing:
event: on_hearing
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: On hearing'
body: |-
Hello,
What you sent about permission to build it, and to know where the case stands is now out to the neighbours and the agencies.
What you can do next: {site}/decide/small-works-application?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
recommended:
event: recommended
approved:
event: approved
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Approved'
body: |-
Hello,
What you sent about permission to build it, and to know where the case stands is now approved.
Solveig Hauge at byggesak@vestmark.example
approved_with_conditions:
event: approved_with_conditions
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Approved with conditions'
body: |-
Hello,
What you sent about permission to build it, and to know where the case stands is now approved on conditions.
Solveig Hauge at byggesak@vestmark.example
refused:
event: refused
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Refused'
body: |-
Hello,
What you sent about permission to build it, and to know where the case stands is now refused.
Solveig Hauge at byggesak@vestmark.example
withdrawn:
event: withdrawn
transitions:
open:
- incomplete
- complete
- withdrawn
incomplete:
- complete
- withdrawn
complete:
- incomplete
- on_hearing
- refused
- withdrawn
on_hearing:
- incomplete
- recommended
- refused
- withdrawn
recommended:
- approved
- approved_with_conditions
- refused
- withdrawn
- bucket: completions
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about the certificate that lets the building be used.
Solveig Hauge at byggesak@vestmark.example
checked:
event: checked
temporary_permission:
event: temporary_permission
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Temporary permission'
body: |-
Hello,
What you sent about the certificate that lets the building be used is now temporary permission to use.
Solveig Hauge at byggesak@vestmark.example
certificate_issued:
event: certificate_issued
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Certificate issued'
body: |-
Hello,
What you sent about the certificate that lets the building be used is now certificate issued.
Solveig Hauge at byggesak@vestmark.example
refused:
event: refused
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Refused'
body: |-
Hello,
What you sent about the certificate that lets the building be used is now refused.
Solveig Hauge at byggesak@vestmark.example
transitions:
checked:
- temporary_permission
- certificate_issued
- refused
open:
- checked
- refused
temporary_permission:
- certificate_issued
- bucket: enquiries
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about to be told where it actually stands.
Solveig Hauge at byggesak@vestmark.example
in_hand:
event: in_hand
answered:
event: answered
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Answered'
body: |-
Hello,
What you sent about to be told where it actually stands is now answered.
Solveig Hauge at byggesak@vestmark.example
transitions:
in_hand:
- answered
open:
- in_hand
- bucket: exemptions
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about to be allowed it anyway, with reasons on the record.
What you can do next: {site}/decide/exemption-request?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
county_asked:
event: county_asked
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: County asked'
body: |-
Hello,
What you sent about to be allowed it anyway, with reasons on the record is now with the county.
What you can do next: {site}/decide/exemption-request?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
county_answered:
event: county_answered
recommended:
event: recommended
granted:
event: granted
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Granted'
body: |-
Hello,
What you sent about to be allowed it anyway, with reasons on the record is now granted.
Solveig Hauge at byggesak@vestmark.example
denied:
event: denied
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Denied'
body: |-
Hello,
What you sent about to be allowed it anyway, with reasons on the record is now denied.
Solveig Hauge at byggesak@vestmark.example
withdrawn:
event: withdrawn
transitions:
county_answered:
- recommended
- denied
- withdrawn
county_asked:
- county_answered
- denied
- withdrawn
open:
- county_asked
- denied
- withdrawn
recommended:
- granted
- denied
- withdrawn
- bucket: firms
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about to be on the list, and then to file without asking again.
What you can do next: {site}/decide/firm-approval?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
papers_missing:
event: papers_missing
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Papers missing'
body: |-
Hello,
What you sent about to be on the list, and then to file without asking again is now waiting on papers.
What you can do next: {site}/decide/firm-approval?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
checked:
event: checked
approved:
event: approved
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Approved'
body: |-
Hello,
What you sent about to be on the list, and then to file without asking again is now approved.
Solveig Hauge at byggesak@vestmark.example
declined:
event: declined
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Declined'
body: |-
Hello,
What you sent about to be on the list, and then to file without asking again is now declined.
Solveig Hauge at byggesak@vestmark.example
transitions:
checked:
- approved
- declined
open:
- papers_missing
- checked
- declined
papers_missing:
- checked
- declined
- bucket: hearing_answers
initial: open
states:
open:
event: received
read:
event: read
followed:
event: followed
set_aside:
event: set_aside
transitions:
open:
- read
- set_aside
read:
- followed
- set_aside
- bucket: hearings
initial: open
states:
open:
event: received
answered:
event: answered
no_answer:
event: no_answer
cancelled:
event: cancelled
transitions:
open:
- answered
- no_answer
- cancelled
attended_by: |
the six-week deadline: when it passes with nothing from the agency the case goes to no_answer and the application goes on without one
- bucket: illegal_building
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about us to go and look, and to hear that we did.
Solveig Hauge at byggesak@vestmark.example
inspected:
event: inspected
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Inspected'
body: |-
Hello,
What you sent about us to go and look, and to hear that we did is now inspected.
Solveig Hauge at byggesak@vestmark.example
owner_asked:
event: owner_asked
explained:
event: explained
resolved:
event: resolved
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Resolved'
body: |-
Hello,
What you sent about us to go and look, and to hear that we did is now resolved.
Solveig Hauge at byggesak@vestmark.example
fined:
event: fined
dropped:
event: dropped
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Dropped'
body: |-
Hello,
What you sent about us to go and look, and to hear that we did is now nothing to pursue.
Solveig Hauge at byggesak@vestmark.example
transitions:
explained:
- resolved
- dropped
inspected:
- owner_asked
- fined
open:
- inspected
- fined
owner_asked:
- explained
- bucket: inspections
initial: open
states:
open:
event: received
as_approved:
event: as_approved
deviation:
event: deviation
put_right:
event: put_right
escalated:
event: escalated
transitions:
deviation:
- as_approved
- put_right
- escalated
open:
- deviation
- escalated
- bucket: meetings
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello {name},
We have received what you sent about to hear what we will allow before paying an architect.
What you can do next: {site}/decide/pre-application-meeting?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
scheduled:
event: scheduled
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Scheduled'
body: |-
Hello {name},
What you sent about to hear what we will allow before paying an architect is now scheduled.
What you can do next: {site}/decide/pre-application-meeting?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
met:
event: met
advised:
event: advised
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Advised'
body: |-
Hello {name},
What you sent about to hear what we will allow before paying an architect is now written advice sent.
Solveig Hauge at byggesak@vestmark.example
cancelled:
event: cancelled
transitions:
met:
- advised
- cancelled
open:
- scheduled
- cancelled
scheduled:
- met
- cancelled
- bucket: objections
initial: open
states:
open:
event: received
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Open'
body: |-
Hello,
We have received what you sent about what they think on the record, and answered in the decision.
What you can do next: {site}/decide/objection?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
registered:
event: registered
answered_by_applicant:
event: answered_by_applicant
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Answered by applicant'
body: |-
Hello,
What you sent about what they think on the record, and answered in the decision is now the applicant has answered.
What you can do next: {site}/decide/objection?chain={chain}&email={email}
Solveig Hauge at byggesak@vestmark.example
addressed:
event: addressed
mail:
to: submitter
subject: 'Vestmark kommune - Building and Planning: Addressed'
body: |-
Hello,
What you sent about what they think on the record, and answered in the decision is now answered in the decision.
Solveig Hauge at byggesak@vestmark.example
withdrawn:
event: withdrawn
transitions:
answered_by_applicant:
- addressed
- withdrawn
open:
- registered
- withdrawn
registered:
- answered_by_applicant
- withdrawn