{
  "schema_version": 1,
  "id": "micro-manufacturing-pod-spec",
  "title": "3D micro-manufacturing + POD order ingest",
  "status": "draft_executable_not_deployed_not_posted",
  "destination": "drewsky.ai",
  "written_at_utc": "2026-09-09T02:07:17+00:00",
  "author": "Drew Beyersdorf",
  "constraints": {
    "no_social_posts_from_this_run": true,
    "no_purchases": true,
    "no_live_printer_dispatch": true,
    "no_pii_in_ledger": true,
    "hmac_secret_not_in_repo": true,
    "stdlib_only": true,
    "package_discovery": "HMAC and JSONL use hashlib/hmac/json. No third-party ingest library."
  },
  "graft_evidence": {
    "command": "graft-assistant map",
    "files": 15,
    "symbols": 266,
    "edges": 705,
    "map_tokens_saved_approx": 47518,
    "hmac_in_live_assistant_graph": false,
    "printer_dispatch_in_live_graph": false
  },
  "pipeline": [
    "HMAC-verify raw webhook body",
    "Reject unknown profile_id and duplicate order_id",
    "Append canonical JSONL line without PII",
    "Map profile_id to Orca process + Klipper START_PRINT temps",
    "Slice with Orca CLI",
    "Moonraker upload with print=false",
    "Human or named agent starts the job after first-layer check"
  ],
  "sku_to_profile": {
    "gridfinity-1x2-pla": "pla-04-020",
    "jetson-case-petg": "petg-04-020",
    "cable-clip-tpu": "tpu-04-024"
  },
  "orca_slicer_profiles": {
    "pla-04-020": {
      "name": "drewsky PLA 0.4mm 0.20mm",
      "compatible_printers": [
        "klipper-generic-0.4"
      ],
      "process": {
        "layer_height": "0.2",
        "initial_layer_print_height": "0.2",
        "wall_loops": "3",
        "top_shell_layers": "5",
        "bottom_shell_layers": "4",
        "sparse_infill_density": "20%",
        "sparse_infill_pattern": "gyroid",
        "nozzle_temperature": [
          "210"
        ],
        "nozzle_temperature_initial_layer": [
          "215"
        ],
        "bed_temperature": [
          "60"
        ],
        "bed_temperature_initial_layer": [
          "60"
        ],
        "outer_wall_speed": "50",
        "inner_wall_speed": "80",
        "sparse_infill_speed": "90",
        "travel_speed": "150",
        "initial_layer_speed": "25",
        "retraction_length": [
          "0.8"
        ],
        "retraction_speed": [
          "30"
        ],
        "filament_max_volumetric_speed": [
          "12"
        ],
        "enable_support": "0",
        "brim_type": "no_brim",
        "file_headers": "1",
        "filename_format": "{input_filename_base}_{filament_type[0]}_{print_time}.gcode"
      },
      "notes": "Direct-drive Klipper. Uncalibrated until first tower on the actual machine. Do not ship functional parts until a 20mm cube measures within 0.2mm."
    },
    "petg-04-020": {
      "name": "drewsky PETG 0.4mm 0.20mm",
      "compatible_printers": [
        "klipper-generic-0.4"
      ],
      "process": {
        "layer_height": "0.2",
        "wall_loops": "4",
        "top_shell_layers": "6",
        "bottom_shell_layers": "5",
        "sparse_infill_density": "30%",
        "sparse_infill_pattern": "gyroid",
        "nozzle_temperature": [
          "245"
        ],
        "nozzle_temperature_initial_layer": [
          "250"
        ],
        "bed_temperature": [
          "80"
        ],
        "bed_temperature_initial_layer": [
          "80"
        ],
        "outer_wall_speed": "40",
        "inner_wall_speed": "60",
        "sparse_infill_speed": "70",
        "travel_speed": "120",
        "initial_layer_speed": "20",
        "retraction_length": [
          "1.2"
        ],
        "retraction_speed": [
          "25"
        ],
        "filament_max_volumetric_speed": [
          "8"
        ],
        "slow_down_layer_time": "12",
        "enable_support": "0",
        "brim_type": "outer_only"
      },
      "notes": "Functional brackets and enclosures. Dry filament. First-layer square required before queueing customer SKUs."
    },
    "tpu-04-024": {
      "name": "drewsky TPU 95A 0.4mm 0.24mm",
      "compatible_printers": [
        "klipper-generic-0.4"
      ],
      "process": {
        "layer_height": "0.24",
        "wall_loops": "2",
        "sparse_infill_density": "15%",
        "sparse_infill_pattern": "grid",
        "nozzle_temperature": [
          "230"
        ],
        "bed_temperature": [
          "40"
        ],
        "outer_wall_speed": "25",
        "inner_wall_speed": "30",
        "travel_speed": "80",
        "retraction_length": [
          "0.4"
        ],
        "filament_max_volumetric_speed": [
          "3"
        ],
        "enable_support": "0",
        "brim_type": "no_brim"
      },
      "notes": "Direct drive only. Disable z-hop if it strings. Not for Bowden."
    }
  },
  "klipper": {
    "macros": {
      "START_PRINT": "[gcode_macro START_PRINT]\ngcode:\n  {% set BED = params.BED|default(60)|float %}\n  {% set EXTRUDER = params.EXTRUDER|default(210)|float %}\n  {% set PROFILE = params.PROFILE|default(\"pla-04-020\") %}\n  G90\n  G28\n  BED_MESH_PROFILE LOAD=default\n  M190 S{BED}\n  M109 S{EXTRUDER}\n  G92 E0\n  SET_GCODE_VARIABLE MACRO=_DREWSKY_JOB VARIABLE=profile VALUE='\"{PROFILE}\"'\n",
      "END_PRINT": "[gcode_macro END_PRINT]\ngcode:\n  M104 S0\n  M140 S0\n  G91\n  G1 E-2 F300\n  G1 Z10 F600\n  G90\n  G1 X0 Y220 F6000\n  M84\n",
      "PAUSE": "[gcode_macro PAUSE]\nrename_existing: PAUSE_BASE\ngcode:\n  PAUSE_BASE\n  M117 paused_fail_closed\n"
    },
    "start_gcode_orca": "START_PRINT BED=[bed_temperature_initial_layer] EXTRUDER=[nozzle_temperature_initial_layer] PROFILE={profile_id}",
    "end_gcode_orca": "END_PRINT",
    "moonraker_upload": {
      "method": "POST",
      "url": "http://printer.local/server/files/upload",
      "form": {
        "file": "@build.gcode",
        "print": "false"
      },
      "rule": "print=false until a human or named agent confirms the receipt. Never auto-start on first ingest."
    }
  },
  "slice_cli": [
    "orca-slicer --slice --load ${PROFILE}.json --output build.gcode part.stl"
  ],
  "ingest": {
    "module": "public/skills/ingest_orders.py",
    "sha256": "de7d171698f626932a6aa2e2981a47891629c6662a7eaddef25fa5f854d31ea1",
    "tests": "public/skills/test_ingest_orders.py",
    "tests_sha256": "15dd559e04c360d1dc5bcf2a760dfb7c334d523afd847b4719f97af0a6417724",
    "command": "python3 -B -I -m unittest discover -s . -p 'test_ingest_orders.py' -v",
    "test_result": "6/6 PASS",
    "signature": "hex HMAC-SHA256 of raw body, header X-Signature-SHA256",
    "secret_env": "ORDER_HMAC_SECRET",
    "ledger": "orders.jsonl append-only",
    "pii_stripped": [
      "address",
      "city",
      "customer",
      "email",
      "name",
      "phone",
      "postal_code",
      "shipping",
      "street",
      "zip"
    ]
  },
  "tiktok_scripts": [
    {
      "id": "tt01-graft-map",
      "length_s": 45,
      "en": {
        "hook_0_3s": "Split screen. Left: opening 15 Python files. Right: one graft map line. Caption: 47,518 tokens vs 674.",
        "voice": "I stopped pasting whole repos into the model. Fifteen files. Forty-eight thousand tokens if you read them. The local AST map is 674 tokens and still names the hubs. That is graft. Tree-sitter on disk. No API bill for the map.",
        "overlay": [
          "15 files",
          "47,518 tokens saved",
          "graft map, $0"
        ],
        "end": "drewsky.ai/skills/code-graph-graft.md. Draft. Not a product pitch."
      },
      "es": {
        "hook_0_3s": "Pantalla partida. Izquierda: 15 archivos. Derecha: graft map. 47.518 tokens contra 674.",
        "voice": "Deje de pegar el repositorio entero al modelo. Quince archivos. Casi 48 mil tokens si los lees. El mapa AST local son 674 tokens y aun nombra los hubs. Graft. Tree-sitter en disco. El mapa no cobra API.",
        "overlay": [
          "15 archivos",
          "47.518 tokens",
          "graft map, 0 USD"
        ],
        "end": "drewsky.ai/skills/grafos-codigo-graft.md"
      }
    },
    {
      "id": "tt02-fail-closed",
      "length_s": 50,
      "en": {
        "hook_0_3s": "Terminal: invalid_source_citation. Then a word count: 122. Cap: 120.",
        "voice": "The compiler failed closed. The write-up said wiki-link markup. The saved JSON had exact keys and no brackets. Every value was 122 words. The cap was 120. Same error code. Wrong repair. Measure the artifact before you patch the prompt.",
        "overlay": [
          "122 words",
          "cap 120",
          "don't trust collapsed errors"
        ],
        "end": "Fail closed. Then name the real limit."
      },
      "es": {
        "hook_0_3s": "Terminal: invalid_source_citation. Conteo: 122 palabras. Limite: 120.",
        "voice": "El compilador cerro en fallo. El informe dijo markup wiki. El JSON tenia claves exactas y sin corchetes. Cada valor: 122 palabras. El tope: 120. Mismo codigo. Reparacion equivocada. Mide el artefacto antes de tocar el prompt.",
        "overlay": [
          "122 palabras",
          "tope 120",
          "no confies en el codigo colapsado"
        ],
        "end": "Fallo cerrado. Luego nombra el limite real."
      }
    },
    {
      "id": "tt03-hmac-klipper",
      "length_s": 55,
      "en": {
        "hook_0_3s": "A JSON line appears. No name. No street. Then OrcaSlicer CLI. Then Klipper idle.",
        "voice": "Shopify-shaped webhook in. HMAC-SHA256 on the raw body. If the signature is wrong, nothing writes. If the order id already exists, nothing writes. The ledger line is order, sku, qty, profile. Names never hit disk. Profile pla-04-020. Slice with print=false. A person still hits start.",
        "overlay": [
          "HMAC on raw body",
          "JSONL, no PII",
          "print=false"
        ],
        "end": "Spec, not a live farm. Tests: 6/6."
      },
      "es": {
        "hook_0_3s": "Una linea JSON. Sin nombre. Sin calle. OrcaSlicer. Klipper en idle.",
        "voice": "Entra un webhook. HMAC-SHA256 del cuerpo crudo. Firma mala: no escribe. Pedido duplicado: no escribe. En el ledger: pedido, sku, cantidad, perfil. Los nombres no tocan disco. Perfil pla-04-020. Laminado con print=false. Una persona da start.",
        "overlay": [
          "HMAC del cuerpo",
          "JSONL sin PII",
          "print=false"
        ],
        "end": "Especificacion. No hay granja en vivo. Tests 6/6."
      }
    },
    {
      "id": "tt04-ast-to-gcode",
      "length_s": 50,
      "en": {
        "hook_0_3s": "graft callers schedule. Arrow to mobile_control, not to a printer.",
        "voice": "People want the code graph to dispatch the printer. The graph said no. schedule lives on phone reminders. Recurrence math from the fleet packet has zero edges into the live assistant. Different contracts. You do not merge them because the names rhyme.",
        "overlay": [
          "graft callers",
          "zero edges",
          "don't merge on rhyme"
        ],
        "end": "Query the graph before you wire hardware."
      },
      "es": {
        "hook_0_3s": "graft callers schedule. La flecha va a recordatorios, no a la impresora.",
        "voice": "Quieren que el grafo de codigo dispare la impresora. El grafo dijo que no. schedule son recordatorios del telefono. La recurrencia del paquete de flota no tiene aristas al asistente en vivo. Contratos distintos. No se fusionan porque se parecen los nombres.",
        "overlay": [
          "graft callers",
          "cero aristas",
          "no fusiones por rima"
        ],
        "end": "Pregunta al grafo antes de cablear hardware."
      }
    },
    {
      "id": "tt05-gridfinity-pod",
      "length_s": 45,
      "en": {
        "hook_0_3s": "A 1x2 Gridfinity bin hitting the plate. Overlay: sku gridfinity-1x2-pla.",
        "voice": "The SKU is the profile. Not a mood board. gridfinity-1x2-pla maps to pla-04-020. OpenSCAD in, STL, Orca CLI, G-code with START_PRINT BED=60 EXTRUDER=210. No Printify key in this path. If we cannot slice it locally, we do not list it.",
        "overlay": [
          "SKU = profile",
          "local slice",
          "no key in the repo"
        ],
        "end": "drewsky.ai/skills/micro-manufacturing-pod-spec.json"
      },
      "es": {
        "hook_0_3s": "Bin Gridfinity 1x2 en la cama. sku gridfinity-1x2-pla.",
        "voice": "El SKU es el perfil. No un mood board. gridfinity-1x2-pla apunta a pla-04-020. OpenSCAD, STL, Orca CLI, G-code START_PRINT BED=60 EXTRUDER=210. No hay clave de Printify en este camino. Si no se puede laminar aqui, no se lista.",
        "overlay": [
          "SKU = perfil",
          "laminado local",
          "sin claves en el repo"
        ],
        "end": "drewsky.ai/skills/micro-manufacturing-pod-spec.json"
      }
    }
  ],
  "reddit_posts": [
    {
      "subreddit": "r/LocalLLaMA",
      "posted": false,
      "draft": "Title: Local AST graphs beat dumping the repo into embeddings (15 files, 47,518 tokens saved on one map)\n\ntbh I got tired of agents grepping then reading whole files because the embedding index was \"close enough.\"\n\nWe put Graft 0.16.0 behind a Bubblewrap launcher. Network off. Cleared env. Fifteen owned Python files mounted read-only. The wiring graph is tree-sitter, no LLM pass.\n\nLast map:\n\n- 15 files, 266 symbols, 705 edges\n- output ~674 tokens\n- reading those files whole ~48,192 tokens\n- reported savings 47,518 (99%)\n\ncallers on a symbol is tens of tokens, not the enclosing 7k-line module. skeleton is signatures. grep groups hits by enclosing symbol.\n\nWhat it does not do: it will not invent a function that is not in the allowlist. parse_intermediate_json was in a frozen compiler candidate. Live graph: no such symbol. That miss stopped us from \"fixing\" the live file.\n\nCost of the map is $0. We still pay for the model that reads the map. The win is not feeding it the repo.\n\nLauncher: /home/drew/.local/bin/graft-assistant (private machine). Public writeup: https://drewsky.ai/skills/code-graph-graft.md\n\nNot selling a SaaS. Numbers above are from one local run, not a published benchmark suite."
    },
    {
      "subreddit": "r/3Dprinting",
      "posted": false,
      "draft": "Title: HMAC order ingest into Klipper without writing customer names to disk\n\nI do not have a twelve-printer farm. I do have a spec I can run tests against.\n\nFlow I actually coded:\n\n1. Storefront (or a fixture) POSTs a JSON body: order_id, sku, qty, profile_id, plus PII it should never persist here.\n2. Header is HMAC-SHA256 of the raw body. compare_digest. Wrong hex: no write.\n3. Duplicate order_id: no second line.\n4. Append-only JSONL: order_id, sku, qty, profile_id, payload sha256, hmac, UTC time. name/email/address/phone stripped.\n5. profile_id is one of pla-04-020, petg-04-020, tpu-04-024. Unknown profile: ValueError, no slice.\n\nOrca process values are boring on purpose. PLA 0.4/0.20, 210/60, 50mm/s outer, gyroid 20%. PETG 245/80, 4 walls. TPU 0.24, 25mm/s, volumetric 3. Direct drive Klipper macros START_PRINT / END_PRINT. Moonraker upload with print=false.\n\nThe code graph on the assistant repo does not contain a printer dispatcher. graft callers schedule points at phone reminders. I am not going to pretend a reminder function is a print queue.\n\nTests: python3 -B -I -m unittest discover -s . -p 'test_ingest_orders.py' -v  -> 6/6.\n\nSpec: https://drewsky.ai/skills/micro-manufacturing-pod-spec.json (draft, not a live shop).\n\nIf your first layer is not in spec, do not set print=true. That is the whole automation."
    }
  ],
  "next_gates": [
    "Calibrate pla-04-020 on a real printer (20mm cube) before listing SKUs",
    "Independent review before any wrangler deploy or social post",
    "Do not merge printer dispatch into live assistant.py"
  ]
}
