How v2-mason/mason-os works
Purpose and Repository Shape
This is an operations/knowledge workspace rather than a single deployable application. It combines personal/project governance, process documentation, and one implemented production system. Top-level portfolio routing is represented by PROJECTS.yaml, SYSTEMS.yaml, and 06 Systems/README.md.
Primary Executable System: DML-Production
06 Systems/DML-Production is the material software system: a customer-inquiry pipeline that accepts Shopify storefront submissions, validates and deduplicates them, records delivery state, and creates/updates CRM data. System-level intent, decisions, and boundaries live in:
• 06 Systems/DML-Production/SYSTEM.md
• 06 Systems/DML-Production/DECISIONS.md
• 06 Systems/DML-Production/docs/boundaries/02-TARGET-BOUNDARIES.md
Storefront and Shopify Entry Points
The customer-facing entry point is a Shopify theme section and page template, with a Shopify app configuration alongside it:
• 06 Systems/DML-Production/apps/inquiry-storefront/sections/inquiry-form.liquid
• 06 Systems/DML-Production/apps/inquiry-storefront/templates/page.inquiry.json
• 06 Systems/DML-Production/apps/inquiry-shopify-app/shopify.app.toml
The storefront produces an inquiry payload; it is a presentation/integration boundary, not the owner of CRM mapping or persistence policy.
Inquiry Integration Domain Pipeline
inquiry-integration contains the reusable domain workflow. Its public entry point accepts an inquiry envelope, normalizes and schema-validates it, establishes identity and company matching, enforces idempotency, and invokes a CRM adapter:
• 06 Systems/DML-Production/apps/inquiry-integration/src/index.js
• 06 Systems/DML-Production/apps/inquiry-integration/src/domain/submit-inquiry.js
• 06 Systems/DML-Production/apps/inquiry-integration/schema/validate.js
Canonical JSON and digests support stable idempotency/conflict handling. Receipt and delivery stores isolate submission state from external CRM effects:
• 06 Systems/DML-Production/apps/inquiry-integration/src/domain/idempotency.js
• 06 Systems/DML-Production/apps/inquiry-integration/src/domain/receipt-store.js
• 06 Systems/DML-Production/apps/inquiry-integration/src/domain/delivery-store.js
API Runtime, Security, and Audit Boundary
inquiry-api is the deployable Node.js HTTP service. Server/runtime setup delegates requests to an application layer, with separate intake and scheduler authentication, rate limiting, configuration, and audit CLI:
• 06 Systems/DML-Production/apps/inquiry-api/src/server.js
• 06 Systems/DML-Production/apps/inquiry-api/src/http-handler.js
• 06 Systems/DML-Production/apps/inquiry-api/src/application.js
Operational controls are explicit at the HTTP boundary:
• 06 Systems/DML-Production/apps/inquiry-api/src/intake-auth.js
• 06 Systems/DML-Production/apps/inquiry-api/src/scheduler-auth.js
• 06 Systems/DML-Production/apps/inquiry-api/src/rate-limit.js
External Services and Persistence
The system integrates with HubSpot through a dedicated transport/adapter boundary and can persist its ledger in Firestore; an in-memory ledger supports local/test runtime:
• 06 Systems/DML-Production/apps/inquiry-api/src/hubspot-crm-adapter.js
• 06 Systems/DML-Production/apps/inquiry-api/src/hubspot-transport.js
• 06 Systems/DML-Production/apps/inquiry-api/src/firestore-ledger.js
Container deployment is indicated by 06 Systems/DML-Production/apps/Dockerfile; project documentation references Cloud Run identity boundaries in 03 Projects/生产自动化采集/01 调研与接口/Developer Mode 与 Cloud Run 身份边界.md.
Operational-Process Project System
03 Projects/打通AM需求到生产放行流程 V1.0 defines the governed AM requirement-to-production-release operating model around HubSpot and Notion. Its core stages are gates 0–6, role/RACI controls, data contracts, technical/DfAM review, capability selection, and BOM/routing release:
• 03 Projects/打通AM需求到生产放行流程 V1.0/01 流程与Gate设计/AM端到端Operating-Model.md
• 03 Projects/打通AM需求到生产放行流程 V1.0/02 表单与记录规范/S0-HubSpot到Validation-Case-Intake数据契约.md
• 03 Projects/打通AM需求到生产放行流程 V1.0/02 表单与记录规范/T6-BOM-Routing质量策划与放行交接.md
Secondary Finance Model
03 Projects/财务系统建立 contains a separate Python financial-model toolchain: database construction, cost/product/company modeling, and quote tooling:
• 03 Projects/财务系统建立/01 模型/scripts/build_finance_db.py
• 03 Projects/财务系统建立/01 模型/scripts/cost_engine.py
• 03 Projects/财务系统建立/01 模型/scripts/run_company_model.py
Main entry points: submit-inquiry.js Submit inquiry · server.js Inquiry API · AM端到端Operating-Model.md Gates 0–6 operating model · PROJECTS.yaml Portfolio routing
Components 22
DML-Production
Customer inquiry pipeline.
- System boundaries · Defines DML intent and integration boundaries.
06 Systems/DML-Production/SYSTEM.md - Shopify inquiry form · Customer-facing inquiry entry point.
06 Systems/DML-Production/apps/inquiry-storefront/sections/inquiry-form.liquid - Shopify app config
06 Systems/DML-Production/apps/inquiry-shopify-app/shopify.app.toml - Inquiry API · Deployable runtime for intake and scheduled delivery.
06 Systems/DML-Production/apps/inquiry-api/src/server.js - HTTP security boundary · Applies intake/scheduler auth and rate limiting.
06 Systems/DML-Production/apps/inquiry-api/src/http-handler.js - API application · Delegates API operations to the integration workflow.
06 Systems/DML-Production/apps/inquiry-api/src/application.js - Inquiry integration · Public reusable inquiry-processing entry point.
06 Systems/DML-Production/apps/inquiry-integration/src/index.js - Submit inquiry · Normalizes, identifies, matches, and submits inquiries.
06 Systems/DML-Production/apps/inquiry-integration/src/domain/submit-inquiry.js - Schema validation
- Idempotency control · Uses canonical payload digests for replay and conflict handling.
06 Systems/DML-Production/apps/inquiry-integration/src/domain/idempotency.js - Receipt & delivery ledger · Separates receipt state from external delivery effects.
06 Systems/DML-Production/apps/inquiry-integration/src/domain/receipt-store.js - Firestore ledger · Production ledger persistence.
06 Systems/DML-Production/apps/inquiry-api/src/firestore-ledger.js - HubSpot CRM adapter · Owns CRM mapping and transport integration.
06 Systems/DML-Production/apps/inquiry-api/src/hubspot-crm-adapter.js - HubSpot
- Container deployment · Deployment artifact for the API runtime.
06 Systems/DML-Production/apps/Dockerfile
AM Release Process
Governed requirement-to-production release model.
- Gates 0–6 operating model · AM requirement-to-production release stages and role controls.
03 Projects/打通AM需求到生产放行流程 V1.0/01 流程与Gate设计/AM端到端Operating-Model.md - HubSpot intake contract · Defines HubSpot-to-validation-case intake data.
03 Projects/打通AM需求到生产放行流程 V1.0/02 表单与记录规范/S0-HubSpot到Validation-Case-Intake数据契约.md - BOM/routing release · Quality planning and production-release handoff.
03 Projects/打通AM需求到生产放行流程 V1.0/02 表单与记录规范/T6-BOM-Routing质量策划与放行交接.md
Finance Model
Python financial modeling toolchain.
- Finance database build
03 Projects/财务系统建立/01 模型/scripts/build_finance_db.py - Cost engine · Cost, product, and company modeling.
03 Projects/财务系统建立/01 模型/scripts/cost_engine.py - Company model runner · Runs company-level financial model and quote tooling.
03 Projects/财务系统建立/01 模型/scripts/run_company_model.py
Other components
- Portfolio routing · Routes projects and systems.
PROJECTS.yaml
Connections 20
- Portfolio routing → System boundaries: indexes
- Portfolio routing → Gates 0–6 operating model: indexes
- Shopify inquiry form → Inquiry API: submits inquiry
- Shopify app config → Shopify inquiry form: supports
- Inquiry API → HTTP security boundary: serves through
- HTTP security boundary → API application: authorized requests
- API application → Inquiry integration: invokes
- Inquiry integration → Submit inquiry: starts workflow
- Submit inquiry → Schema validation: validates
- Submit inquiry → Idempotency control: deduplicates
- Idempotency control → Receipt & delivery ledger: records state
- Receipt & delivery ledger → Firestore ledger: persists via
- Submit inquiry → HubSpot CRM adapter: delivers CRM changes
- HubSpot CRM adapter → HubSpot: creates or updates
- Container deployment → Inquiry API: packages
- HubSpot intake contract → Gates 0–6 operating model: governs Gate 0 intake
- Gates 0–6 operating model → BOM/routing release: culminates in
- HubSpot → HubSpot intake contract: source data
- Finance database build → Cost engine: provides model data
- Cost engine → Company model runner: feeds