From 040a95ee0798fd472cf6ac5209fedb44b45d4e14 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Fri, 25 Sep 2026 21:35:32 +0200 Subject: [PATCH] A submitter's own moves say where they may be made from portal compiles one access rule per state a self_transition names, and without them assumed the day the case arrived. The builder already knew the answer - `moves_of(need, SUBMITTER)` carries the from-state of every move - and now writes it down, so the applicant answering a request for papers from `incomplete` gets a rule for it, and withdrawal is offered from wherever the case has got to. Measured on the building authority: the submitter had two rules, both out of `open`. It now has ten, across applications and appeals. Co-Authored-By: Claude Opus 5 (1M context) --- runs/permits-2026-09-25/questions/decide/appeal.yaml | 4 ++++ .../questions/decide/exemption-request.yaml | 5 +++++ .../questions/decide/firm-approval.yaml | 3 +++ .../questions/decide/objection.yaml | 4 ++++ .../questions/decide/permit-application.yaml | 9 +++++++++ .../questions/decide/pre-application-meeting.yaml | 4 ++++ .../questions/decide/small-works-application.yaml | 9 +++++++++ src/build.rs | 11 ++++++++++- 8 files changed, 48 insertions(+), 1 deletion(-) diff --git a/runs/permits-2026-09-25/questions/decide/appeal.yaml b/runs/permits-2026-09-25/questions/decide/appeal.yaml index 9b0f503..e042d0b 100644 --- a/runs/permits-2026-09-25/questions/decide/appeal.yaml +++ b/runs/permits-2026-09-25/questions/decide/appeal.yaml @@ -6,4 +6,8 @@ alternatives: self_transition: bucket: appeals to: withdrawn + from: + - before_the_board + - open + - reconsidered label: Withdrawn diff --git a/runs/permits-2026-09-25/questions/decide/exemption-request.yaml b/runs/permits-2026-09-25/questions/decide/exemption-request.yaml index 647cfbc..0f2ef89 100644 --- a/runs/permits-2026-09-25/questions/decide/exemption-request.yaml +++ b/runs/permits-2026-09-25/questions/decide/exemption-request.yaml @@ -6,4 +6,9 @@ alternatives: self_transition: bucket: exemptions to: withdrawn + from: + - county_answered + - county_asked + - open + - recommended label: Withdrawn diff --git a/runs/permits-2026-09-25/questions/decide/firm-approval.yaml b/runs/permits-2026-09-25/questions/decide/firm-approval.yaml index c858427..3946a5c 100644 --- a/runs/permits-2026-09-25/questions/decide/firm-approval.yaml +++ b/runs/permits-2026-09-25/questions/decide/firm-approval.yaml @@ -6,4 +6,7 @@ alternatives: self_transition: bucket: firms to: checked + from: + - open + - papers_missing label: Checked diff --git a/runs/permits-2026-09-25/questions/decide/objection.yaml b/runs/permits-2026-09-25/questions/decide/objection.yaml index 7ddb909..211161b 100644 --- a/runs/permits-2026-09-25/questions/decide/objection.yaml +++ b/runs/permits-2026-09-25/questions/decide/objection.yaml @@ -6,4 +6,8 @@ alternatives: self_transition: bucket: objections to: withdrawn + from: + - answered_by_applicant + - open + - registered label: Withdrawn diff --git a/runs/permits-2026-09-25/questions/decide/permit-application.yaml b/runs/permits-2026-09-25/questions/decide/permit-application.yaml index b90eacf..4343447 100644 --- a/runs/permits-2026-09-25/questions/decide/permit-application.yaml +++ b/runs/permits-2026-09-25/questions/decide/permit-application.yaml @@ -6,10 +6,19 @@ alternatives: self_transition: bucket: applications to: complete + from: + - incomplete + - open label: Complete - name: Withdrawn description: '' self_transition: bucket: applications to: withdrawn + from: + - complete + - incomplete + - on_hearing + - open + - recommended label: Withdrawn diff --git a/runs/permits-2026-09-25/questions/decide/pre-application-meeting.yaml b/runs/permits-2026-09-25/questions/decide/pre-application-meeting.yaml index 315bde5..3f67819 100644 --- a/runs/permits-2026-09-25/questions/decide/pre-application-meeting.yaml +++ b/runs/permits-2026-09-25/questions/decide/pre-application-meeting.yaml @@ -6,4 +6,8 @@ alternatives: self_transition: bucket: meetings to: cancelled + from: + - met + - open + - scheduled label: Cancelled diff --git a/runs/permits-2026-09-25/questions/decide/small-works-application.yaml b/runs/permits-2026-09-25/questions/decide/small-works-application.yaml index b90eacf..4343447 100644 --- a/runs/permits-2026-09-25/questions/decide/small-works-application.yaml +++ b/runs/permits-2026-09-25/questions/decide/small-works-application.yaml @@ -6,10 +6,19 @@ alternatives: self_transition: bucket: applications to: complete + from: + - incomplete + - open label: Complete - name: Withdrawn description: '' self_transition: bucket: applications to: withdrawn + from: + - complete + - incomplete + - on_hearing + - open + - recommended label: Withdrawn diff --git a/src/build.rs b/src/build.rs index 5dfc9b5..1197a70 100644 --- a/src/build.rs +++ b/src/build.rs @@ -1595,6 +1595,15 @@ pub fn render(plan: &Plan, words: &BTreeMap) -> anyhow::Result = theirs.iter().map(|(_, to)| to).collect(); + // Where each of their moves may be made from. A person is in + // dialogue with their case for as long as it runs: the + // applicant answers a request for papers from `incomplete`, + // and withdraws from wherever the case has got to by then. + // Portal compiles one policy rule per state named here, and + // without them it assumes the day the case arrived. + let from_for = |to: &String| -> Vec<&String> { + theirs.iter().filter(|(_, t)| t == to).map(|(from, _)| from).collect() + }; files.insert( path, json!({ @@ -1603,7 +1612,7 @@ pub fn render(plan: &Plan, words: &BTreeMap) -> anyhow::Result>(), }), );