← All seeds & suites
permitdesk ADL 0.5.1 Municipal Government

Permit Desk

Building and land-use permitting where AI conducts initial completeness screening and municipal staff make every review, fee, inspection, and issuance decision.

Resources (9)
permittype, parcel, applicant, application, submittal, screening, review, fee, inspection
Roles (6)
*, clerk, inspector, reviewer, supervisor, admin
Features (10)
suitepermissionsstate_machinevalidationrules_engineviewsscheduled_tasksaudithistory_eventsindexes

permit-desk.infinity-sdg.com — building and land-use permitting for a local government. An AI does the first completeness screen; staff make every decision.

applicant + parcel + permit type → application (draft)
  → submit ─ needs documents
  → screening ─ AI drafts "complete / incomplete, what's missing, how sure"
               staff confirm or override it
  → accept (needs a staff-confirmed complete screening)  ·  or return incomplete → resubmit
  → discipline reviews: building, zoning, fire, environmental, historic …
       approve  ·  corrections → re-review
  → approve (every review approved)  ·  or deny, with a reason
  → fees: pay (receipt) or waive (reason)
  → issue (permit number, expiry; fees settled)
  → inspections: pass · fail (notes) → reschedule
  → finalize (passed final inspection)   ·   nightly: unfinaled permits past expiry expire

What it enforces

RuleWhy
Submit needs at least one documentNo empty applications in the queue
Accept needs a staff-confirmed complete screeningThe AI triages; a person decides
An incomplete screening must list what’s missing; an AI screening must report its confidenceApplicants get actionable feedback; staff see how sure the model was
Flood-zone parcels need an elevation survey before acceptanceFloodplain compliance
Approve needs every discipline review approvedNo partial sign-off
Deny, return, corrections, failed inspections and fee waivers all require a written reasonEvery adverse action is explainable
Issue needs fees assessed and all paid or waivedNo permit before payment
Inspections only on issued permits; finalize only after a passed finalField work follows the paperwork
Contractors must give a license numberLicensing check at intake

Every resource is audited. Applications keep a readable history of each state change, with its reason.

Resources, views, roles

  • Resources:
    • Reference data: permittype, parcel, applicant
    • The application itself
    • Application records: submittal, screening, review, fee, inspection
  • Views:
    • reviewQueue, with an overdue flag
    • screeningsToConfirm (AI screens waiting for a person)
    • inspectionsToday
    • pipeline
  • Roles:
    • clerk: intake, screening, fees
    • reviewer: plan review
    • inspector: field inspections
    • supervisor: approve, deny, waive
    • admin

Demo data

The demo is a fictional county with 10 permit types and 14 applications, at least one in every state:

  • 4 finaled: a new home, a deck, rooftop solar with a waived surcharge, and a flood-zone pool
  • 2 issued with inspections under way, one with a failed framing inspection that has been rescheduled
  • 1 approved, with fees outstanding
  • 1 in review with building corrections
  • 1 where staff overrode an AI screening that missed the energy report
  • 1 AI screening waiting for staff
  • 1 returned incomplete (missing owner authorization)
  • 1 denied (lit sign in a historic district)
  • 1 draft
  • 1 withdrawn

All people, places and parcel numbers are invented, and phone numbers use the 555 range. To regenerate the data, run python3 seeds/gen_seed.py.

Run it

scripts/kalos.sh validate    # static checks
scripts/kalos.sh start       # kalosd on :9212
scripts/kalos.sh verify      # live checks

By default, KALOS_REPO is ../kalos.

Sign in with admin / Admin123!. The other users are clerk1, reviewer1, inspector1 and supervisor1, all with password Demo123!.

Front-end assets

Run scripts/check-assets.sh to verify the photographs, share card, icons and their page references. The generated photographs’ provenance and full prompts are in CREDITS.md.

To rebuild the share card and touch icon from the existing SVG mark, run node scripts/render-brand-assets.mjs with Node.js and Google Chrome installed. Set CHROME_BIN for another Chrome executable. Rendering uses local fonts, as the site does; no packages or network requests are needed.

Domain Resource Summary

ResourcePurpose & Lifecycle
permittypeA kind of permit the office issues, and what it requires.
parcelA tax parcel: where the work happens.
applicantThe owner or contractor applying.
applicationA permit application, from draft to finaled permit. (States: draft, submitted, incomplete, in_review, approved, issued, finaled, denied, withdrawn, expired)
submittalA document submitted with an application.
screeningA completeness check. The AI drafts it (what’s missing, how sure); a staff member confirms or overrides it. Only confirmed screenings count. (States: pending, confirmed, overridden)
reviewOne discipline’s plan review of an application. (States: assigned, corrections, approved)
feeA fee assessed on an application. (States: assessed, paid, waived)
inspectionA field inspection of permitted work. (States: scheduled, failed, passed)
Inspect domain.yaml (465 lines)
# permit-desk/backend/domain.yaml
#
# Permit Desk — building and land-use permits for a local government.
#
#   applicant + parcel + permit type → application (draft)
#     → submit (needs submittals)
#     → screening: an AI completeness check drafts the finding, staff confirm it
#     → accept (needs a staff-confirmed "complete" screening) or return incomplete
#     → discipline reviews (building, zoning, fire, …) approve or ask for corrections
#     → approve (every review approved) → fees → issue (every fee paid or waived)
#     → inspections → finalize (a passed final inspection)
#   Issued permits that pass their expiry date unfinaled expire nightly.
#
# The AI never decides: its screening is a draft until a staff member confirms
# it, and only a confirmed screening can move an application into review.
#
# An ISDG product for municipal and county permitting offices.
# query() filter keys are single lowercase words.

domain:
  name: permitdesk
  version: "1.0.0"
  description: >
    Permit applications, AI-assisted completeness screening with staff
    confirmation, discipline plan review, fees, inspections and issuance.

  resources:

    permittype:
      description: "A kind of permit the office issues, and what it requires."
      object:
        id:           { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        code:         { type: string, required: true, unique: true, maxLength: 20, pattern: "^[A-Z][A-Z0-9-]*$" }
        name:         { type: string, required: true, maxLength: 120 }
        requiredDocs: { type: text, required: true }
        baseFee:      { type: money, required: true, min: 0 }
        validDays:    { type: integer, required: true, min: 30, max: 1095 }
        active:       { type: boolean, required: true, default: true }
      permissions:
        list:   ["*"]
        get:    ["*"]
        create: [admin]
        update: [admin]
        delete: [admin]
      features: { audit: true }

    parcel:
      description: "A tax parcel: where the work happens."
      object:
        id:        { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        apn:       { type: string, required: true, unique: true, maxLength: 30 }
        address:   { type: string, required: true, maxLength: 200 }
        zoning:    { type: string, required: true, enum: [R1, R2, R3, MU, C1, C2, I1, AG] }
        floodZone: { type: boolean, required: true, default: false }
        historic:  { type: boolean, required: true, default: false }
      permissions:
        list:   [clerk, reviewer, inspector, supervisor, admin]
        get:    [clerk, reviewer, inspector, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, admin]
        delete: [admin]
      features: { audit: true }

    applicant:
      description: "The owner or contractor applying."
      object:
        id:        { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        name:      { type: string, required: true, maxLength: 120 }
        company:   { type: string, maxLength: 120 }
        email:     { type: email, required: true }
        phone:     { type: phone, required: true }
        role:      { type: string, required: true, enum: [owner, contractor, architect, engineer, agent] }
        licenseNo: { type: string, maxLength: 40 }
      validation:
        contractorsAreLicensed:
          rule: "role != 'contractor' || licenseNo != null"
          message: "Contractors must give a license number."
      permissions:
        list:   [clerk, reviewer, supervisor, admin]
        get:    [clerk, reviewer, inspector, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, admin]
        delete: [admin]
      features: { audit: true }

    application:
      description: "A permit application, from draft to finaled permit."
      object:
        id:          { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        number:      { type: string, required: true, unique: true, maxLength: 20 }
        permittype:
          type: reference
          references: "adl.permitdesk.permitdesk.permittype"
          required: true
        parcel:
          type: reference
          references: "adl.permitdesk.permitdesk.parcel"
          required: true
        applicant:
          type: reference
          references: "adl.permitdesk.permitdesk.applicant"
          required: true
        workDescription: { type: text, required: true }
        valuation:   { type: money, required: true, min: 0 }
        submittedAt: { type: datetime }
        acceptedAt:  { type: datetime }
        approvedAt:  { type: datetime }
        permitNumber: { type: string, maxLength: 20 }
        issuedAt:    { type: datetime }
        expiresOn:   { type: date }
        finaledAt:   { type: datetime }
        returnReason: { type: text }
        denialReason: { type: text }
        status:      { type: string, required: true, default: draft }
      stateMachine:
        field: status
        initial: draft
        states:
          draft:
            transitions:
              submit:   { to: submitted, guards: [clerk, admin], sets: { submittedAt: now() } }
              withdraw: { to: withdrawn, guards: [clerk, admin] }
          submitted:
            transitions:
              accept:         { to: in_review, guards: [clerk, supervisor, admin], sets: { acceptedAt: now() } }
              returnIncomplete: { to: incomplete, guards: [clerk, supervisor, admin], requiredFields: [returnReason] }
              withdraw:       { to: withdrawn, guards: [clerk, admin] }
          incomplete:
            transitions:
              resubmit: { to: submitted, guards: [clerk, admin], sets: { submittedAt: now() } }
              withdraw: { to: withdrawn, guards: [clerk, admin] }
          in_review:
            transitions:
              approve: { to: approved, guards: [supervisor, admin], sets: { approvedAt: now() } }
              deny:    { to: denied, guards: [supervisor, admin], requiredFields: [denialReason] }
          approved:
            transitions:
              issue: { to: issued, guards: [clerk, supervisor, admin], requiredFields: [permitNumber, expiresOn], sets: { issuedAt: now() } }
          issued:
            transitions:
              finalize: { to: finaled, guards: [inspector, supervisor, admin], sets: { finaledAt: now() } }
              expire:   { to: expired, guards: [supervisor, admin] }
          finaled: {}
          denied: {}
          withdrawn: {}
          expired: {}
      permissions:
        list:   [clerk, reviewer, inspector, supervisor, admin]
        get:    [clerk, reviewer, inspector, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, inspector, supervisor, admin]
        delete: [admin]
      features: { audit: true }
      history:
        events:
          submitted:  { trigger: transition, transition: submit, severity: info }
          returned:   { trigger: transition, transition: returnIncomplete, capture: [returnReason], label: "Returned: {returnReason}", severity: warning }
          accepted:   { trigger: transition, transition: accept, severity: info }
          approved:   { trigger: transition, transition: approve, severity: success }
          denied:     { trigger: transition, transition: deny, capture: [denialReason], label: "Denied: {denialReason}", severity: error }
          issued:     { trigger: transition, transition: issue, capture: [permitNumber], label: "Permit {permitNumber} issued", severity: success }
          finaled:    { trigger: transition, transition: finalize, severity: success }
      indexes:
        - { fields: [status] }
        - { fields: [parcel] }
        - { fields: [applicant] }

    submittal:
      description: "A document submitted with an application."
      object:
        id:          { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        application:
          type: reference
          references: "adl.permitdesk.permitdesk.application"
          required: true
        kind:        { type: string, required: true, enum: [site_plan, floor_plan, elevations, structural_calcs, energy_compliance, survey, contractor_license, owner_authorization, photos] }
        fileName:    { type: string, required: true, maxLength: 200 }
        pages:       { type: integer, required: true, min: 1 }
        revision:    { type: integer, required: true, min: 1, default: 1 }
      permissions:
        list:   [clerk, reviewer, inspector, supervisor, admin]
        get:    [clerk, reviewer, inspector, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [application] }

    screening:
      description: >
        A completeness check. The AI drafts it (what's missing, how sure);
        a staff member confirms or overrides it. Only confirmed screenings count.
      object:
        id:           { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        application:
          type: reference
          references: "adl.permitdesk.permitdesk.application"
          required: true
        origin:       { type: string, required: true, enum: [ai, staff] }
        result:       { type: string, required: true, enum: [complete, incomplete] }
        missingItems: { type: text }
        confidence:   { type: percentage }
        confirmedBy:  { type: string, maxLength: 100 }
        confirmedAt:  { type: datetime }
        status:       { type: string, required: true, default: pending }
      validation:
        incompleteNamesWhatIsMissing:
          rule: "result != 'incomplete' || missingItems != null"
          message: "An incomplete screening must list what is missing."
        aiGivesConfidence:
          rule: "origin != 'ai' || confidence != null"
          message: "An AI screening must report its confidence."
      stateMachine:
        field: status
        initial: pending
        states:
          pending:
            transitions:
              confirm:  { to: confirmed, guards: [clerk, supervisor, admin], sets: { confirmedBy: $user.id, confirmedAt: now() } }
              override: { to: overridden, guards: [clerk, supervisor, admin], sets: { confirmedBy: $user.id, confirmedAt: now() } }
          confirmed: {}
          overridden: {}
      permissions:
        list:   [clerk, reviewer, supervisor, admin]
        get:    [clerk, reviewer, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, supervisor, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [application] }

    review:
      description: "One discipline's plan review of an application."
      object:
        id:          { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        application:
          type: reference
          references: "adl.permitdesk.permitdesk.application"
          required: true
        discipline:  { type: string, required: true, enum: [building, zoning, fire, engineering, environmental, historic] }
        reviewer:    { type: string, required: true, maxLength: 100 }
        dueOn:       { type: date, required: true }
        comments:    { type: text }
        cycle:       { type: integer, required: true, min: 1, default: 1 }
        decidedAt:   { type: datetime }
        status:      { type: string, required: true, default: assigned }
      stateMachine:
        field: status
        initial: assigned
        states:
          assigned:
            transitions:
              approve:     { to: approved, guards: [reviewer, supervisor, admin], sets: { decidedAt: now() } }
              corrections: { to: corrections, guards: [reviewer, supervisor, admin], requiredFields: [comments], sets: { decidedAt: now() } }
          corrections:
            transitions:
              rereview: { to: assigned, guards: [reviewer, supervisor, admin] }
          approved: {}
      permissions:
        list:   [clerk, reviewer, supervisor, admin]
        get:    [clerk, reviewer, inspector, supervisor, admin]
        create: [clerk, supervisor, admin]
        update: [reviewer, supervisor, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [application] }
        - { fields: [status, dueOn] }

    fee:
      description: "A fee assessed on an application."
      object:
        id:           { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        application:
          type: reference
          references: "adl.permitdesk.permitdesk.application"
          required: true
        description:  { type: string, required: true, maxLength: 120 }
        amount:       { type: money, required: true, min: 0 }
        receiptNo:    { type: string, maxLength: 30 }
        waiverReason: { type: text }
        paidAt:       { type: datetime }
        status:       { type: string, required: true, default: assessed }
      stateMachine:
        field: status
        initial: assessed
        states:
          assessed:
            transitions:
              pay:   { to: paid, guards: [clerk, admin], requiredFields: [receiptNo], sets: { paidAt: now() } }
              waive: { to: waived, guards: [supervisor, admin], requiredFields: [waiverReason] }
          paid: {}
          waived: {}
      permissions:
        list:   [clerk, supervisor, admin]
        get:    [clerk, supervisor, admin]
        create: [clerk, admin]
        update: [clerk, supervisor, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [application] }

    inspection:
      description: "A field inspection of permitted work."
      object:
        id:          { type: uuid, primaryKey: true, protected: true, allowUserProvided: true }
        application:
          type: reference
          references: "adl.permitdesk.permitdesk.application"
          required: true
        kind:        { type: string, required: true, enum: [footing, foundation, framing, electrical_rough, plumbing_rough, mechanical_rough, insulation, final] }
        scheduledOn: { type: date, required: true }
        inspector:   { type: string, required: true, maxLength: 100 }
        notes:       { type: text }
        resultAt:    { type: datetime }
        status:      { type: string, required: true, default: scheduled }
      stateMachine:
        field: status
        initial: scheduled
        states:
          scheduled:
            transitions:
              pass: { to: passed, guards: [inspector, admin], sets: { resultAt: now() } }
              fail: { to: failed, guards: [inspector, admin], requiredFields: [notes], sets: { resultAt: now() } }
          failed:
            transitions:
              reschedule: { to: scheduled, guards: [clerk, inspector, admin] }
          passed: {}
      permissions:
        list:   [clerk, inspector, supervisor, admin]
        get:    [clerk, inspector, supervisor, admin]
        create: [clerk, inspector, admin]
        update: [clerk, inspector, admin]
        delete: [admin]
      features: { audit: true }
      indexes:
        - { fields: [application] }
        - { fields: [status, scheduledOn] }

  rules:

    submitNeedsDocuments:
      description: "Nothing is submitted without at least one document."
      trigger: { resource: application, events: [transition], transition: submit }
      condition: "len(query('submittal', { application: $record.id })) == 0"
      action: reject
      severity: error
      message: "Attach the required documents before submitting."

    acceptNeedsConfirmedCompleteness:
      description: "Only a staff-confirmed 'complete' screening moves an application into review — the AI never decides alone."
      trigger: { resource: application, events: [transition], transition: accept }
      condition: "len(query('screening', { application: $record.id, result: 'complete', status: 'confirmed' })) == 0"
      action: reject
      severity: error
      message: "A staff member must confirm a complete screening first."

    approveNeedsEveryReview:
      description: "Approval needs at least one review, and every review approved."
      trigger: { resource: application, events: [transition], transition: approve }
      condition: "len(query('review', { application: $record.id })) == 0
                  || some(query('review', { application: $record.id }), r => r.status != 'approved')"
      action: reject
      severity: error
      message: "Every discipline review must be approved first."

    issueNeedsSettledFees:
      description: "A permit is issued only when fees are assessed and all paid or waived."
      trigger: { resource: application, events: [transition], transition: issue }
      condition: "len(query('fee', { application: $record.id })) == 0
                  || len(query('fee', { application: $record.id, status: 'assessed' })) > 0"
      action: reject
      severity: error
      message: "Assess fees and settle them before issuing."

    finalizeNeedsPassedFinal:
      description: "A permit is finaled only after a passed final inspection."
      trigger: { resource: application, events: [transition], transition: finalize }
      condition: "len(query('inspection', { application: $record.id, kind: 'final', status: 'passed' })) == 0"
      action: reject
      severity: error
      message: "The final inspection has not passed."

    inspectOnlyIssuedPermits:
      description: "Inspections are scheduled only for issued permits."
      trigger: { resource: inspection, events: [create] }
      condition: "some(query('application', { id: $record.application }), a => a.status != 'issued')"
      action: reject
      severity: error
      message: "The permit is not issued."

    floodZoneNeedsSurvey:
      description: "Work in a flood zone needs a survey on file."
      trigger: { resource: application, events: [transition], transition: accept }
      condition: "some(query('parcel', { id: $record.parcel }), p => p.floodZone == true)
                  && len(query('submittal', { application: $record.id, kind: 'survey' })) == 0"
      action: reject
      severity: error
      message: "Parcel is in a flood zone; an elevation survey is required."

  schedules:

    expireLapsedPermits:
      description: "Issued permits past their expiry date without a final inspection expire every night."
      recurrence: daily at 01:00
      source:
        resource: application
        filter: "status == 'issued' && expiresOn < today()"
      action: transition
      transition: expire

  views:

    reviewQueue:
      description: "Open plan reviews by due date."
      source: review
      filter: "status == 'assigned'"
      permissions: [reviewer, supervisor, admin]
      columns:
        - { field: discipline, label: "Discipline" }
        - { field: reviewer,   label: "Reviewer" }
        - { field: dueOn,      label: "Due" }
        - { field: cycle,      label: "Cycle" }
        - name: overdue
          label: "Overdue"
          computed: "dueOn < today()"
      defaultLimit: 200

    screeningsToConfirm:
      description: "AI completeness checks waiting for a person."
      source: screening
      filter: "status == 'pending'"
      permissions: [clerk, supervisor, admin]
      columns:
        - { field: origin,       label: "By" }
        - { field: result,       label: "Result" }
        - { field: confidence,   label: "Confidence" }
        - { field: missingItems, label: "Missing" }
      defaultLimit: 200

    inspectionsToday:
      description: "Scheduled inspections."
      source: inspection
      filter: "status == 'scheduled'"
      permissions: [inspector, supervisor, admin]
      columns:
        - { field: kind,        label: "Inspection" }
        - { field: scheduledOn, label: "Date" }
        - { field: inspector,   label: "Inspector" }
      defaultLimit: 200

    pipeline:
      description: "Every application and where it stands."
      source: application
      permissions: [clerk, reviewer, inspector, supervisor, admin]
      columns:
        - { field: number,       label: "Application" }
        - { field: status,       label: "State" }
        - { field: submittedAt,  label: "Submitted" }
        - { field: permitNumber, label: "Permit" }
        - { field: expiresOn,    label: "Expires" }
      defaultLimit: 500

Download seed bundle