Welcome to WeylandAI

Consulting Handoff Package — SubmittalExpress / TakeOffExpress Platform

MHS v1.6 — Chain & Anchor

01 Executive Summary

WeylandAI's SubmittalExpress and TakeOffExpress products are a Cloudflare-native SaaS platform for construction door hardware estimating. The platform extracts hardware schedules from architectural PDFs using AI vision, lets users affirm the data through a human-guided workflow, generates professional quotes, and assembles submittal packages. PAD (Precision Auto Doors) funded $15K for buildout with validated $2K/month/seat pricing.

96 Total Tickets
42 Complete
36 Active
14K+ Worker Lines
1.1MB Frontend (subx.html)
89+ D1 Tables
3,635 Indexed Symbols
10 HASCOM Providers
Critical Path to Demo

Pipeline Unification Phases 1–3 DEPLOYED → Extraction Flow Unification (29A audit COMPLETE, 29B–D PLANNED) → Takeoff Table Redesign → Demo-Ready Product. The backend is more complete than the frontend — the light reaches the tube but doesn't yet reach the eyepiece.

02 Platform Architecture

Stack

Cloudflare-Native, Zero Dependencies

Workerweyland-worker.js — 14K+ lines, pure JS, Cloudflare Workers runtime
Frontendsubx.html — 1.1MB single-page application, Cloudflare Pages
DatabaseCloudflare D1 (weyland_db) — 89+ tables, SQLite at edge
StorageCloudflare R2 — subx-uploads (PDFs), subx-outputs (generated docs)
CacheCloudflare KV — rendered pages, session state
RenderingCloudflare Browser Rendering (Puppeteer) — 600 DPI extraction, quote PDFs
QueueCloudflare Queues — cut sheet discovery pipeline
AIClaude Vision API — hardware schedule extraction, constraint-driven prompts

Extraction Pipeline Flow

Upload PDF DETECT (text layer → vision fallback) Candidates User reviews schedule regions AFFIRM (600 DPI render) Human confirms regions EXTRACT (Claude Vision + constraint prompts) Store door_schedule_entries / hardware_page_extractions Materialize hardware_sets + hardware_components Takeoff Project-scoped aggregation + pricing Quote HTML template + Browser PDF + R2 storage Submittal Package Cover + TOC + HW Set Pages + Cut Sheets

The Affirmation Boundary

Core Design Principle

"Nothing enters assembly-connected infrastructure until affirmed by a human operator and completeness-checked at generation time."

Three Affirm Gates: MARK→HW GROUP (Gate 1) | Components (Gate 2) | Quantities (Gate 3). Each affirmation is literal proof of work. The affirm_audit_log is the permanent source of truth. The AI extracts, the human affirms, and only then does the system act.

Domains

DomainPurposeServing
api.weylandai.comWorker API backendCloudflare Worker (weyland)
subx.weylandai.comSubmittalExpress product appCloudflare Pages (submittalexpress)
weylandai.comCorporate site + static pagesCloudflare Pages (submittalexpress)
consenta.ccConsenta CRM/ERP forkCloudflare Worker + Pages (consenta)

03 HASCOM Toolkit — 10 Feature Gifts

HASCOM (originally "MHS Autonomous Systems Command") is the substrate-agnostic infrastructure layer — a fractal capability registry that works with any AI system. These ten features have been battle-tested across 10+ engineering sessions and are ready for immediate use. View complete source code →

Design philosophy: "HASCOM is AI-agnostic infrastructure; building with MCP might over-optimize toward a fleeting point in time."

1

hascom query Symbol-Level Indexing

Multi-table search across 3,635 indexed symbols in 63 files. Returns exact file:line for routes, functions, tables, columns, and API calls. Completes in 0.7 seconds. The single command that kills the naming mismatch pattern — seven instances discovered (26A through 26N) where unexercised code referenced nonexistent column names.

Impact: ~80% fewer tool calls, ~70% fewer tokens vs raw Glob/Grep exploration. One shell call replaces 15–25 agent tool calls.

2

hascom brief Domain Briefing

Generates a structured briefing document for any registered domain in the MHS ecosystem. Returns file inventory, capability map, relationship graph, and key patterns. Any new collaborator (human or AI) gets oriented in seconds.

Impact: Eliminates the "where do I start?" problem for new agents joining a session.

3

hascom context Agent Context Generation

Generates a .hascom_context.md file for injection into any AI agent's context window. Contains the symbol index, domain relationships, and key patterns — formatted for consumption by Claude, GPT, Gemini, or any future system.

Impact: Zero vendor lock-in. Works with any substrate that can read markdown.

4

hascom analyze Codebase Analysis

Powered by analyzers.py — extracts symbols from JavaScript/Python codebases. Parses route definitions, function signatures, CREATE TABLE statements, column definitions, and API call patterns. Stores results in taxonomy.db (14.7MB SQLite, FTS5 search-enabled).

Impact: Rebuilds the full symbol index in seconds. Run after any major refactor to keep the knowledge graph current.

5

hascom uat UAT Suite Framework

Drop-in test suites via get_suite() convention (mirrors Flask's get_provider()). Auto-discovered by pkgutil.iter_modules. Kahn topological sort for dependency graphs. 49 tests across 7+ suites. Includes UATSession (urllib, JWT auth), 16 reusable assertions, structured reporting with JSON export.

Impact: Zero framework changes for new suites. Drop a file in uat/suites/, export get_suite(), done.

6

Taxonomy Database

14.7MB SQLite database at C:\MHS\hascom\taxonomy.db. Contains 9,300+ files, 4,800+ relationships, and 3,635 symbols. FTS5-enabled for full-text search. Domains include athena_system, hascom, ventures, mhsync, subx_tickets, and more.

Impact: The knowledge graph that makes all other HASCOM commands possible. Crawled and indexed automatically.

7

DevTools Provider — 33 Browser Capabilities

V2.0 general browser infrastructure. Persistent daemon bridge (WS:9876 + HTTP:9877). Includes devtools.find_browser, devtools.screenshot, devtools.console, devtools.network, devtools.run (JS execution via clipboard paste), devtools.topmost (pin any window). Works across Chrome, Edge, and other Chromium browsers.

Impact: Any WRIGHT can see what the browser sees. Born from extraction UAT; evolved into general browser automation by CAPT directive.

8

Site Profiles — JSON-Driven Navigation

JSON site profile definitions (sites/subx.json, sites/consenta.json). Define navigation flows, authentication sequences, and page state queries for any web application. Used with site_nav, site_action, site_state, site_login capabilities.

Impact: "Build general capabilities enabling testing of any webpage for any WRIGHT." — CAPT

9

Daemon Bridge — Persistent WS Connection

WebSocket bridge (port 9876) + HTTP API (port 9877) for persistent browser communication. bridge.py implements BrowserTarget + resolve_target (DNS-style window resolution). 9-step safe bootstrap via bridge_inject. Token-per-session auth (Jupyter model). Auto-token-refresh via JWT decode.

Impact: Site profiles over app-specific providers. WebSocket bridge over CDP (works with all browsers including Safari).

10

Collaboration Briefings & Session Notes

Multi-agent session context management via collab_briefings/ directory. Each collaboration session gets a unique briefing file (collab-{hash}.md) containing session context, discoveries, and state. Combined with SESSION_NOTES_*.md for human-readable session journals and HASCOM source reference for agent orientation.

Impact: Seamless context transfer between agents and sessions. No "cold start" for returning collaborators.

Quick Start

# The one command every collaborator needs
cd C:\MHS
python -m hascom query "hardware_sets."

# Domain briefing
python -m hascom brief athena_system

# Run UAT suite
python -m hascom uat run suite_deploy

# Full codebase re-index
python -m hascom analyze

# Login for API testing
python -m hascom login --token <JWT>

04 Progress Timeline — Feb 6–14, 2026

Eight engineering sessions over nine days. From gap analysis to production deployment across extraction, takeoff, quoting, document intelligence, and developer tooling.

2026-02-06 · BOSUN v1.6 Session 1

Gap Analyses & Vendor Profile (26F, 26G, 26H)

First Opus 4.6 BOSUN session. Two E2E gap analyses delivered (Submittal + Takeoff). Four new tickets cut (26G–26J). 26H Vendor Profile deployed — 6 gates pass. 26F Preview Overhaul confirmed complete by evolution. Index rev 3.27→3.28.

2026-02-09 · Sessions 2–6 (Marathon Day)

Pipeline Unification + HASCOM UAT + Quote Persistence

Five sessions in one day. 26K materialization bridge. 26L re-extraction interlock. 26J quote persistence deployed. HASCOM UAT toolkit built (9 files). HASCOM-001 taxonomy bridge. Pipeline Unification Phases 1–2 deployed (project-scoped takeoff, bulk session linking, backfill bridge, auto-link on upload, DSE→line items materialization, set-level price overrides). Index rev 3.29→3.33.

2026-02-10 · Sessions 7–9

Quote HTML Engine + Consenta Phase 1 + Pipeline Phase 3

CAPT architecture pivot: Vision API extraction for quote rendering REJECTED — replaced with HTML+CSS+env.BROWSER. 26N HTML engine deployed. 26M card-level re-extraction deployed (collaborating WRIGHT pattern). Consenta Phase 1 complete (16 table renames, 9 file renames, 91 D1 tables). Project-scoped quote generation deployed. CPS Price-Informed Takeoff deployed. Index rev 3.35→3.37.

2026-02-11 · BOSUN Session 10

26O Shareable Quote Links + Migration Gap Pattern

26O code was already deployed across 3+ worker deploys but migration 042 was never applied to D1. Quote list endpoints returning 500. Migration gap pattern documented as eighth pattern class. Applied migration, redeployed. Index rev 3.38→3.39.

2026-02-12 · Document Intelligence

Family 27: Bookmark-First Discovery (27A)

27A deployed: pdf.js getOutline() bookmark parsing, schedule auto-detection via keyword+AIA+CSI patterns, sheet index sidebar, page range scoping, presigned R2 upload for any file size. OOM fix for 111MB PDFs (R2 streaming). Migration 044 applied.

2026-02-13 · HASCOM v2.0

28A Browser Infra + 28B Symbol Indexing

The session that unlocked everything. 28A: Daemon bridge + auth handshake + site profiles + 33 capabilities + 49 UAT tests (48 PASS). 28B: Symbol-level indexing — 3,635 symbols, 63 files, 0.7s analysis. hascom query becomes the one command to onboard any new collaborator. Index rev 3.47.

2026-02-13–14 · Extraction Audit

Family 29: Extraction Flow Unification (29A)

29A audit complete: Full backend+frontend extraction audit. Range fix deployed. Three extraction paths (detect→affirm→extract, batch-extract, region re-extract) should converge to one coordinated flow. Fetch-after-extract gap identified. CAPT takeoff table + quote package directives captured. Index rev 3.48.

05 Key Files & Metadata

Source Files

FileSizeRoleLast Modified
weyland-worker.js ~14K lines API backend — all routes, auth, extraction orchestration, takeoff, quotes 2026-02-13
deployment/public/subx.html 1,171,028 bytes Single-page frontend — viewer, extraction UI, takeoff, settings 2026-02-13
hardware-schedule-extractor.js ~5K lines Extraction engine — prompts, parsing, region rendering, constraint architecture 2026-02-13
submittal-assembler.js ~1K lines PDF assembly — cover, TOC, HW set pages, cut sheet insertion 2026-02-09
takeoff-quote-generator.js ~767 lines Quote HTML engine (v4.0) — pure HTML, env.BROWSER PDF render 2026-02-10
data-transformer.js ~1.5K lines Data transformation — materializeAffirmedGroup, DSE bridge 2026-02-09
discovery-engine.js ~800 lines Cut sheet discovery — CPS catalogue matching, queue consumer 2026-01-30

Configuration & Infrastructure

FileRoleKey Detail
wrangler.toml Deployment config v2.4.1. Routes: api.weylandai.com/*, subx.weylandai.com/quote/*, subx.weylandai.com/q/*
deployment/public/_worker.js Pages routing Advanced mode: domain-based routing (weylandai.com → corporate, subx → app)
deployment/public/_headers Security headers CSP, CORS, frame protection. Updated 2026-02-13 (fonts.googleapis.com added)
migrations/001–044 D1 schema evolution 44 migrations applied. 89+ tables. Latest: migration 044 (27A document discovery)

Ticket & Framework Files

FileRoleRev
Phase2Tickets/00_PHASE2_TICKET_INDEX.json Master ticket index — families, gates, recon, five-field summary 3.48
rulesv1.5/MHS_CONSTITUTION_v1.5.json Framework constitution — Chain & Anchor protocol 1.5
Phase2Tickets/CE_NOTE_2026-0209_TakeoffPipelineUnification.json Pipeline unification strategy — 4 phases, demo-critical

06 Deployment Guide

Worker (API Backend)

# Deploy to production
npx wrangler deploy

# Verify
curl https://api.weylandai.com/api/health

Worker name is weyland (not subx-worker). No --name flag needed.

Pages (Frontend)

# Deploy to production
npx wrangler pages deploy \
  deployment/public \
  --project-name=submittalexpress \
  --branch=production

--branch=production is MANDATORY. Without it, deploys go to preview/alpha and production stays stale.

Migration Gap Pattern

npx wrangler deploy carries all JS changes. But D1 migrations require separate execution:

npx wrangler d1 execute weyland_db --remote --file=migrations/044_xxx.sql

This pattern caused 26O (shareable quote links) to ship code but not schema — quote list endpoints returned 500 for days. Always verify migrations after deploy.

D1 Database

# Query production D1
npx wrangler d1 execute weyland_db --remote --command="SELECT name FROM sqlite_master WHERE type='table' ORDER BY name"

# Run migration (use --file, not --command for long SQL)
npx wrangler d1 execute weyland_db --remote --file=migrations/044_document_discovery.sql

Quick Deploy Both

npx wrangler deploy && npx wrangler pages deploy deployment/public --project-name=submittalexpress --branch=production

07 Known Issues & Service Regressions

Fetch-After-Extract Gap

Batch-extract deposits data in D1 but frontend stores groups:[] in local state and never fetches the data back from the server. Three extraction paths (detect→affirm→extract, batch-extract, region re-extract) operate independently with no coordinated post-extraction data refresh.

IDENTIFIED Ticket 29B planned. Source: 29A audit (2026-02-13).

Batch-Extract OOM on Large PDFs

renderRegionAt600DPI receives full pdfBuffer (e.g., 111MB) instead of pdfStreamUrl. Worker exceeds 128MB memory limit. R2 streaming fix exists (KV-first → R2-stream-fallback) but is not wired into the batch-extract call site (~L3489).

PARTIAL FIX R2 streaming wired for extract-affirmed path. Batch-extract path still uses buffer. Source: DX-2026-0212-001.

Cross-Page Continuation Groups (Orphan Drop)

parseHardwareExtractionResult silently drops groups with no identifier via console.warn + continue. Hardware schedules spanning page breaks lose continuation components. The extraction prompts have zero vocabulary for "continuation" or "orphan."

SPECIFIED Ticket 29B — Orphan Group Detection & Merge. Three-layer fix: prompt engineering, parser orphan detection, frontend resolution UI.

CORS on 5xx Responses

Worker omits CORS headers when returning 500-class errors. Frontend fetch() sees CORS error instead of the actual error message, making debugging difficult.

TODO Identified during 28A diagnostics session.

Kaiser Session Linking

47 Kaiser Sunset sessions exist as orphans with no cross-session linking. 35 door_schedule type, 7 hardware_schedule type. Zero door_schedule_entries persisted. Auto-link on upload (exact name match) is deployed but retroactive linking requires manual bulk-link API call.

TOOLS EXIST POST /api/projects/:projectId/link-sessions + backfill-bridge deployed. Requires CAPT execution.

08 Delivery Roadmap

Active Ticket Families

FamilyTitleStatusNext Step
26 E2E Pipeline — Andrew's Workflow Wave 1–2 DONE 26P Digital Acceptance, 26Q White Label
27 Document Intelligence 27A DEPLOYED 27B Font CMap Reconstruction, 27C HASCOM Doc Taxonomy
28 HASCOM DevTools V2.0 COMPLETE Tier 2 capabilities (navigate, click, fill, assert)
29 Extraction Flow Unification 29A AUDIT DONE 29B Orphan Merge, 29C Takeoff Redesign, 29D Quote Restructure

CAPT Design Directives (from 29A)

Design Ethos
  • Range is the primary selection mechanism — works independently, no index required
  • Index enriches when present — shows which pages are what, allows surgical deselection
  • Hit extract, it goes — range alone is sufficient to trigger extraction
  • One thoughtful flow, not three separate paths
  • 1-page quote + expanded line item addendums as single exported package
  • Columns: Make, Model, Finish (if), Key (if), Unit Price, Qty
  • "Smooth and soothing on the ear" — design ethos must continue in code and service rendered

Revenue Context

PAD paid $15K for buildout. Customers lined up for monthly seat demos. $2K/month/seat validated by Andrew. Every engineering session should drive toward demo-ready. The backend is more complete than the frontend — the pipeline works, the data flows, but the user-facing takeoff table and quote package need the redesign captured in 29C/29D.

09 Quick-Start Commands

HASCOM (from C:\MHS)

# Symbol query — the one command to rule them all
python -m hascom query "hardware_sets."
python -m hascom query "GET.*takeoff"
python -m hascom query "generateQuoteHtml"
python -m hascom query "migration"

# Domain briefing
python -m hascom brief athena_system

# Re-index after code changes
python -m hascom analyze

# Run UAT tests
python -m hascom uat run suite_deploy
python -m hascom uat run suite_26j

# Check auth token status
python -m hascom uat token-status

# Login for API testing
python -m hascom login --token <JWT-from-browser>

Deployment (from Prototype1/)

# Deploy worker + pages (production)
npx wrangler deploy && \
npx wrangler pages deploy deployment/public \
  --project-name=submittalexpress --branch=production

# Run D1 migration
npx wrangler d1 execute weyland_db --remote --file=migrations/044_xxx.sql

# Check D1 tables
npx wrangler d1 execute weyland_db --remote \
  --command="SELECT name FROM sqlite_master WHERE type='table'"

# Tail production logs
npx wrangler tail

Git (from phase2/Phase2Tickets/)

# Current state
git log --oneline -10
git status

# Latest commits
# a2193a3 v3.48: Families 27-29
# 3c2c4af v3.39: BOSUN session 10
# e725d52 v3.31: BOSUN session 26L/26I/26M
# 2a2e4f5 26K: Materialization bridge
# ea44326 v3.29a: BOSUN review 26H