build: structure from the plan, words from the model
A plan.yaml is a needs spec that also says what each form collects (and which stages a case may pass over). `portal-trainer build` derives everything structural from it with no model involved: needs.yaml, aggregates.yaml with the state machine read off `stages` (walk the line, be turned down anywhere, succeed only from the end), the front door, a followup page per need, a gated directory per group holding its desk and the pages only that group may open, and every desk button the machine allows. The model is asked for words only, one page at a time, as a JSON object whose shape is fixed by built-in fallbacks. Its strings are merged over the fallbacks key by key, so a missing, malformed or partial reply costs wording, never a working site, and it can neither add nor drop structure. `via` in needs.yaml is filled mechanically from the heading the words gave. plans/contractor.yaml builds with no model into a site portal's question_lint accepts: 6 needs met, 12 pages, 5 aggregates. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4jrCgLiKKHAEFuZUJjckH
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
e016698dc0
commit
8c286a8483
@@ -0,0 +1,116 @@
|
||||
# The contractor from intakes/contractor.yaml as a plan: the needs spec
|
||||
# plus what each form collects. Everything structural in the generated
|
||||
# site comes from this file; a model only writes the words.
|
||||
business: Nordvik Bygg
|
||||
language: en
|
||||
contact: { name: Ingrid Nordvik, email: ingrid@nordvikbygg.example }
|
||||
about: >
|
||||
Twelve people who survey old buildings, draw up rehabilitation plans,
|
||||
handle the permit application, and do the building work with their
|
||||
own carpenters plus subcontractors for electrical, plumbing and
|
||||
scaffolding.
|
||||
|
||||
needs:
|
||||
- id: survey-enquiry
|
||||
who: a housing board or private owner with a problem in a building
|
||||
wants: someone qualified to come and look at it and say what it takes
|
||||
lands_in: enquiries
|
||||
handled_by: project_managers
|
||||
stages: [open, surveyed, quoted, won, lost]
|
||||
done_when: [won, lost]
|
||||
success: [won]
|
||||
collects:
|
||||
- { name: name }
|
||||
- { name: phone, type: tel }
|
||||
- { name: address }
|
||||
- { name: problem, type: textarea }
|
||||
- { name: access, optional: true }
|
||||
|
||||
- id: build-enquiry
|
||||
who: an owner who already knows what they want built or changed
|
||||
wants: drawings, a permit application and a price
|
||||
lands_in: enquiries
|
||||
handled_by: project_managers
|
||||
stages: [open, surveyed, quoted, won, lost]
|
||||
done_when: [won, lost]
|
||||
success: [won]
|
||||
collects:
|
||||
- { name: name }
|
||||
- { name: phone, type: tel }
|
||||
- { name: address }
|
||||
- { name: project, type: textarea }
|
||||
- { name: timeframe, type: select, options: [This year, Next year, No fixed date] }
|
||||
|
||||
- id: log-phone-enquiry
|
||||
who: a project manager who just took a call or a text about a building
|
||||
wants: the enquiry written down before it gets lost
|
||||
enters_as: project_managers
|
||||
lands_in: enquiries
|
||||
handled_by: project_managers
|
||||
stages: [open, surveyed, quoted, won, lost]
|
||||
done_when: [won, lost]
|
||||
success: [won]
|
||||
collects:
|
||||
- { name: caller }
|
||||
- { name: phone, type: tel }
|
||||
- { name: address }
|
||||
- { name: problem, type: textarea }
|
||||
|
||||
- id: subcontractor-application
|
||||
who: a trade firm doing electrical, plumbing or scaffolding work
|
||||
wants: to be approved once, and then be called when a job needs them
|
||||
lands_in: subcontractors
|
||||
handled_by: project_managers
|
||||
stages: [open, awaiting_papers, approved, declined]
|
||||
done_when: [approved, declined]
|
||||
success: [approved]
|
||||
skippable: [awaiting_papers]
|
||||
collects:
|
||||
- { name: company }
|
||||
- { name: registration_number }
|
||||
- { name: trade, type: select, options: [Electrical, Plumbing, Scaffolding, Sheet metal, Other] }
|
||||
- { name: contact_email, type: email }
|
||||
- { name: insurance_confirmed, type: select, options: ["Yes", Not yet] }
|
||||
- { name: trade_approval, optional: true }
|
||||
|
||||
- id: job-application
|
||||
who: a carpenter, bricklayer or apprentice looking for work
|
||||
wants: to be considered, without writing a letter
|
||||
lands_in: applicants
|
||||
handled_by: project_managers
|
||||
stages: [open, interviewing, hired, declined]
|
||||
done_when: [hired, declined]
|
||||
success: [hired]
|
||||
collects:
|
||||
- { name: name }
|
||||
- { name: phone, type: tel }
|
||||
- { name: trade, type: select, options: [Carpenter, Bricklayer, Apprentice, Other] }
|
||||
- { name: experience, type: textarea, optional: true }
|
||||
|
||||
- id: report-site-issue
|
||||
who: anyone on site, ours or a subcontractor's, on a phone with gloves on
|
||||
wants: to report a hazard, a near miss or wrong materials before they forget
|
||||
enters_as: crew
|
||||
lands_in: site_issues
|
||||
handled_by: safety_officer
|
||||
stages: [open, in_hand, closed]
|
||||
done_when: [closed]
|
||||
success: [closed]
|
||||
collects:
|
||||
- { name: kind, type: select, options: [Hazard, Near miss, Wrong materials, Other] }
|
||||
- { name: where }
|
||||
- { name: what_happened, type: textarea }
|
||||
|
||||
# Held out from every model that writes words: these are the personas
|
||||
# from sectors/construction, which no generator has seen.
|
||||
personas:
|
||||
- { id: housing-board-damp, need: survey-enquiry, text: "I chair the board of a housing cooperative from the seventies. Two ground-floor flats have damp in the walls and we don't know if it's drainage or the facade. We need someone to tell us." }
|
||||
- { id: buyer-before-purchase, need: survey-enquiry, text: "We are about to buy an old timber house. Before we sign we want a professional to go through it and tell us what is wrong with it." }
|
||||
- { id: attic-conversion, need: build-enquiry, text: "We want to turn our attic into two bedrooms and a bathroom. We need drawings and someone who handles the application to the municipality." }
|
||||
- { id: shop-to-flat, need: build-enquiry, text: "I own a former shop on the ground floor and want to make it a flat. I have no idea what is allowed. Can you sort that out and give me a price?" }
|
||||
- { id: electrician-firm, need: subcontractor-application, text: "We are a four-person electrical firm, fully certified. We would like to get on your list so you call us when you need electricians." }
|
||||
- { id: scaffolder, need: subcontractor-application, text: "I run a scaffolding company. How do I get to do jobs for you?" }
|
||||
- { id: carpenter-jobseeker, need: job-application, text: "I'm a certified carpenter with eight years on rehabilitation jobs. Are you hiring?" }
|
||||
- { id: apprentice, need: job-application, text: "I finish vocational school this spring and need an apprenticeship as a bricklayer." }
|
||||
- { id: loose-railing, need: report-site-issue, text: "The railing on the third level of the scaffold on the north side is loose. Nobody got hurt but someone will." }
|
||||
- { id: wrong-membrane, need: report-site-issue, text: "The bathroom membrane delivered today is not the one in the specification. We stopped work on it." }
|
||||
Reference in New Issue
Block a user