PRECISION AUTO DOORS / SPEC

Technical Specification v1.0.0

System architecture, API reference, and data models for Precision Auto Doors (PAD).

1. Architecture Overview

PAD runs entirely on Cloudflare edge infrastructure, routed through the MASCOM multi-tenant edge router. No origin server. All compute, storage, and database operations execute at the edge.

Compute
Cloudflare Workers
Storage
R2 Object Store
Database
D1 (SQLite)
Edge Router
mascom-edge
Platform
WeylandAI
Domain
pad.weylandai.com

Request Flow

Client -> Cloudflare CDN -> mascom-edge Worker
  -> Static: R2 (versioned, cache-busted via data-build)
  -> API:    pad-weylandai-com-api Worker -> D1

2. Stack

LayerTechnologyNotes
Edge Routermascom-edgeMulti-tenant R2 router, venture_routing D1 table
API Workerpad-weylandai-com-apiHandles /api/* routes, business logic
DatabaseCloudflare D1SQLite at edge, ~5ms reads
Object StorageCloudflare R2Blueprints, attachments, static assets
AuthAuthFor SSOauthfor.com/sdk/v1/authfor.min.js
PaymentsVendyAISubscription billing, invoice generation
NotificationsMailGuyAIEmail alerts, bid notifications
AI InferenceWeylandAI PlatformBlueprint parsing, schedule extraction

3. API Reference

Base URL: https://pad.weylandai.com/api. All endpoints require a valid AuthFor session token in the Authorization header.

Projects

MethodEndpointDescription
GET/api/projectsList projects for authenticated contractor. Supports ?status= filter.
GET/api/projects/:idGet project detail including bid history and hardware schedule.
POST/api/projectsCreate project. Accepts blueprint upload (multipart/form-data).
PUT/api/projects/:idUpdate project metadata, status transitions.
DEL/api/projects/:idSoft-delete. Archived projects retained 90 days.

Bids

MethodEndpointDescription
GET/api/bidsList bids. Filter by ?project_id= or ?contractor_id=.
POST/api/bidsSubmit bid against a project. Triggers MailGuyAI notification to GC.
PUT/api/bids/:idRevise bid. Only allowed while status is submitted.
POST/api/bids/:id/acceptGC accepts bid. Triggers VendyAI escrow hold.

Hardware Schedules

MethodEndpointDescription
GET/api/hardwareList hardware schedules for a project.
POST/api/hardware/extractAI extraction. Upload blueprint PDF, returns parsed door schedule.
PUT/api/hardware/:idManual override of extracted schedule line items.

Contractors

MethodEndpointDescription
GET/api/contractors/meCurrent contractor profile (from AuthFor session).
PUT/api/contractors/meUpdate profile, certifications, service area.
GET/api/contractors/searchSearch contractors by region, certification, capacity.

4. Data Model

projects

bids

hardware_schedules

contractors

5. Auth Flow

PAD delegates all authentication to AuthFor (authfor.com). No passwords are stored in PAD's database.

1
User visits pad.weylandai.com. Page loads authfor.min.js SDK.
2
SDK checks for existing session cookie. If absent, redirects to AuthFor login.
3
User authenticates via AuthFor (email/password, OAuth, or device auth).
4
AuthFor issues JWT. SDK stores in HttpOnly cookie, redirects back to PAD.
5
PAD API Worker validates JWT on every request via AuthFor's /verify endpoint (cached 5 min).
6
JWT payload contains user_id, email, roles[]. PAD maps user_id to contractors.id.
// SDK initialization
AuthFor.init({
  app: 'pad-weylandai',
  redirect: 'https://pad.weylandai.com/dashboard',
  scopes: ['profile', 'email']
});

// API Worker JWT validation
const { valid, payload } = await authfor.verify(request.headers.get('Authorization'));
if (!valid) return new Response('Unauthorized', { status: 401 });

6. AI Capabilities

Blueprint Hardware Schedule Extraction

Contractors upload architectural blueprint PDFs. The WeylandAI platform processes them to extract door schedules, hardware groups, and fire ratings.

POST /api/hardware/extract
Content-Type: multipart/form-data

Response:
{
  "project_id": "proj_8f2a...",
  "doors_found": 47,
  "confidence_avg": 0.91,
  "schedule": [
    {
      "door_mark": "D-101",
      "door_type": "hollow_metal",
      "width": 36, "height": 84,
      "fire_rating": "90min",
      "hardware_group": "HW-3",
      "confidence": 0.95
    }
  ],
  "warnings": ["D-218: fire rating unclear, manual review recommended"]
}

Auto-Estimation

Given a hardware schedule, PAD generates bid estimates using historical pricing data, regional material costs, and labor rates. Contractors can accept the estimate as a starting point or override line items.

POST /api/bids/estimate
{ "project_id": "proj_8f2a...", "markup_pct": 15 }

Response:
{
  "estimated_total_cents": 4872500,
  "line_items": [
    { "door_mark": "D-101", "material_cents": 48000, "labor_cents": 12000, "hardware_cents": 35000 }
  ],
  "data_sources": ["regional_avg_2025Q4", "rs_means", "historical_bids"]
}

7. Integration Points

ServiceVentureIntegration
AuthenticationAuthForSSO SDK, JWT verify API, user provisioning webhooks
PaymentsVendyAISubscription billing (free/pro/enterprise), bid escrow holds, invoice generation
NotificationsMailGuyAIBid submitted/accepted/rejected alerts, project status changes, deadline reminders
AI PlatformWeylandAIBlueprint OCR, schedule extraction, cost estimation models
Edge Routingmascom-edgeStatic asset delivery from R2, API path routing to worker

8. Deployment

# Static assets (HTML/CSS/JS) deployed via mascom-edge
python3 mascom_edge_deploy.py spec/index.html \
  --hostname pad.weylandai.com \
  --path /spec/index.html \
  --tag spec-v1

# API worker
cd workers/pad-weylandai-com-api
npx wrangler deploy

# D1 migrations
npx wrangler d1 migrations apply pad-db --remote

Precision Auto Doors — a WeylandAI platform product. Part of the MobCorp venture fleet.
Specification version 1.0.0 — 2026-03-04

MASCOM PublicOS WeylandAI GameGob HelmCorp FilmLine HALside News AuthFor