Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All commands in `~/Developer/hacka/Tagwerk`, with `export PYTHONPATH=$PWD`.

## Seeded state (Hörsaal, data date 26.11.2026)
The seed is on plan so that one sentence flips it: Ist 81.7 % / Soll 80 %, SPI 1.02, forecast = baseline 01.12.2026,
no activity late. Bestuhlung neu (A1080) runs 23.-30.11., AV-Technik (A1060) 20.-27.11., Abnahme (A1090) on 01.12.
"Stuhlreihe A ist montiert. Zwei Mann vom Trockenbau sind krank. Kratzer an der Bühne." gives: A1080 52.3 -> 57.8 %,
finish 30.11. -> 02.12., Abnahme 01.12. -> 03.12. (+2 AT), cause "2 of 3 Trockenbau absent today", 2 open defects.

## Before the slot
1. Plug in, disable suspend (a resume can break CUDA: `cuInit 999`; fix = stop gnome-remote-desktop,
`sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm`).
Expand Down
Binary file added docs/design-brief/Tagwerk-Pitch-7.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions mobile/scripts/cors-proxy.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Dev-only: lets the Expo web build call the laptop API (which sends no CORS headers). Not used by the phone.
import http from "node:http";
import net from "node:net";
const target = process.argv[2] || "http://100.118.181.69:8082";
http.createServer((req, res) => {
const cors = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "*", "Access-Control-Allow-Methods": "GET,POST,OPTIONS" };
Expand All @@ -10,4 +11,13 @@ http.createServer((req, res) => {
});
p.on("error", (e) => { res.writeHead(502, cors); res.end(JSON.stringify({ detail: String(e) })); });
req.pipe(p);
}).on("upgrade", (req, socket, head) => {
// the app's live channel (websocket /events: pipeline steps, refresh on update) goes through the same address
const u = new URL(target);
const up = net.connect(Number(u.port) || 80, u.hostname, () => {
const h = Object.entries({ ...req.headers, host: u.host }).map(([k, v]) => `${k}: ${v}`).join("\r\n");
up.write(`${req.method} ${req.url} HTTP/1.1\r\n${h}\r\n\r\n`); up.write(head);
up.pipe(socket); socket.pipe(up);
});
up.on("error", () => socket.destroy()); socket.on("error", () => up.destroy());
}).listen(8099, () => console.log("proxy :8099 ->", target));
5 changes: 3 additions & 2 deletions mobile/src/screens/Capture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { RecordingPresets, requestRecordingPermissionsAsync, setAudioModeAsync,
import * as ImagePicker from "expo-image-picker";
import { Camera, Images, Mic, Send, Square, Video, WifiOff, X } from "lucide-react-native";
import React, { useState } from "react";
import { Pressable, ScrollView, View } from "react-native";
import { Platform, Pressable, ScrollView, View } from "react-native";
import { MediaFile, Zone } from "../api";
import { JobCard } from "../JobCard";
import { Job, enqueue, newId } from "../queue";
Expand Down Expand Up @@ -125,7 +125,8 @@ export function Capture({ zones, jobs, names, toast, online, openSettings }: {
<Icon as={Images} className="size-4" /><Text>Aus Galerie wählen</Text>
</Button>

<Textarea value={note} onChangeText={setNote} className="mt-2 text-base"
{/* web: the field grows with the text like on the phone (Tailwind 3 has no field-sizing class) */}
<Textarea value={note} onChangeText={setNote} className="mt-2 text-base" style={Platform.OS === "web" ? ({ fieldSizing: "content" } as any) : undefined}
placeholder="Notiz (optional), z. B. „Estrich Saal fertig, 2 Mann krank“" />

{draft.length > 0 && (
Expand Down
14 changes: 14 additions & 0 deletions pitch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ node scripts/make-vo.mjs --measure-only # after dropping real recordings (e.g. E

Scene lengths stretch to fit each voice-over clip (`src/vo.json`).

## 2-minute submission video

Composition `Submission` (`video/src/Submission.tsx`), contract in `STORYBOARD-2min.md`. Shot times are fixed in
`video/src/submission-timeline.json`; per-shot cuts, zooms and highlight boxes are in `REC` in `Submission.tsx`.

```sh
cd pitch/video
npm run render:submission # lists public/rec/*.mp4 into src/rec-manifest.json, then -> out/tagwerk-submission.mp4
node scripts/make-submission-vo.mjs # placeholder voice-over from vo/submission-lines.json (macOS `say`)
node scripts/make-submission-vo.mjs --measure-only # after dropping real clips into public/vo/sub-<id>.wav
```

A recording missing from `public/rec/` renders as a labelled placeholder. Script for ElevenLabs: `video/vo/SUBMISSION-ELEVENLABS.md`.

## Deck

```sh
Expand Down
53 changes: 53 additions & 0 deletions pitch/STORYBOARD-2min.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Submission storyboard: 2-minute demo video and 7-slide deck

Hard rules of the submission:
- **Deck:** PDF, max. 7 slides. Problem (short, precise, technical) · Solution (what we built, how it solves it) · Tech stack and architecture.
- **Video:** max. 2:00. Screen recording with voice-over. Must include a live demo of the working prototype and explain the technical approach. Slides allowed, a real demo is required.

Budget: 0:00–0:30 problem, 0:30–2:00 the platform, navigated and clicked. English voice-over and captions; the UI stays German.

## What must come across
1. **How we link:** every site observation is tied to an element, a P6 activity and a GAEB contract position, at the moment it is captured.
2. **The ontology layer:** one graph, GAEB position → activity → element/place → recording → event/proposal (`seed/ontology.yaml`, Neo4j projection).
3. **Why we are different:** voice (or a tap) confirms, the camera alone only proposes; states only go up; every percent is traceable to a sentence. No scanner, no BIM required, runs on one 6 GB GPU laptop.
4. **Alerts and events:** absences, defects, delays are captured as events and attached to the affected activity.
5. **Prediction:** the forecast re-simulates the remaining work (crew minus absences, FS/SS successors) and moves the finish date.
6. **Stakeholders and pipelines:** site manager (phone), Bauleiter (dashboard, daily report, notice draft), office (P6 XML, GAEB, .ics exports).

## The one story (Hörsaal Sanierung, data date Thu 26.11.2026)
Seeded state: on plan. 81.7 % done / 80 % planned, SPI 1.02, finish 01.12., one camera proposal waiting (Stuhlreihe F, Unterkonstruktion).
The site manager sends, zone **Zuschauerraum**:

> Stuhlreihe A ist montiert. Zwei Mann vom Trockenbau sind krank. Kratzer an der Bühne.

Result: Stuhlreihe A 50 → 85 % (bestätigt), 2× Trockenbau krank (absence on A1080), defect logged. Bestuhlung neu 30.11. → 02.12.,
Abnahme 01.12. → 03.12. (+2 AT), cause "2 of 3 Trockenbau absent today". Then one tap on the phone confirms the camera proposal for Reihe F.

On this Mac there is no GPU, Whisper or YOLO, so the note is **typed** (a typed note counts like voice). Never show or say that
speech or vision ran in this recording. The pipeline (Whisper, YOLO11s + YOLO-World, RelateAnything, SfM) is described as the
architecture; real detection output on the host's site footage exists in `docs/design-brief/site-frames/` (`det-*.jpg`, `boxes.json`).

## Shots (file names are the contract between the agents)
Recordings go to `pitch/video/public/rec/<id>.mp4` (H.264, 30 fps, no audio), each with `<id>.json`
(`{"seconds": n, "marks": {"name": seconds, ...}}` for moments the editor needs, e.g. the click or the flip).

| # | Time | id | Source | What is seen | Point made |
|---|---|---|---|---|---|
| P1 | 0:00–0:12 | (clip) `opening-baugrube.mp4` / pit clip | site footage | Real excavation: struts, excavator on rock, dump trailer | A site changes every hour |
| P2 | 0:12–0:22 | (clip) crane clip + four "tool" tiles | site footage + graphics | Diary, schedule (P6), contract (GAEB), claims: four tools, nothing linked | The technical problem: no shared key between observation, schedule and contract |
| P3 | 0:22–0:30 | title | graphics | Tagwerk: capture once, linked everywhere | Solution in one line |
| D1 | 0:30–0:39 | `phone-capture` | phone (app web build, 375×812) | Erfassen: zone Zuschauerraum, typed note, Senden, pipeline steps | One tap on site |
| D2 | 0:39–0:46 | `phone-result` | phone | Result card: green bestätigt, absence, defect | What Tagwerk understood |
| D3 | 0:46–0:58 | `dash-flip` | dashboard :8080 | Dashboard open and green; the capture arrives live; KPI turns red, Gantt bars shift, event cards appear | Alerts, events, prediction |
| D4 | 0:58–1:08 | `dash-trace` | dashboard | Click "Bestuhlung neu": sheet with cause, GAEB position 01.06.0010, recordings; open the recording | How we link |
| D5 | 1:08–1:20 | `dash-graph` | dashboard, Live-Graph tab | The graph: GAEB → Vorgang → Ort → Aufnahme → Ereignis; hover/click the new recording node and the red activity | The ontology layer |
| D6 | 1:20–1:28 | `dash-forecast` | dashboard | Day slider: step back a few days and forward past today (forecast), back to Heute | Past, present, predicted future in one model |
| D7 | 1:28–1:36 | `phone-confirm` | phone, Heute tab | Proposal card (amber) → tap Bestätigen → activity bar moves | Camera proposes, a tap confirms |
| D8 | 1:36–1:45 | `dash-report` | dashboard | Tagesbericht for 26.11.: work done, absence, delays with cause; scroll; Druckversion | Daily report writes itself; office exports |
| D9 | 1:45–1:52 | `dash-bim` | dashboard :8081 | BIM-Modell tab, "Bauablauf abspielen" | With BIM: 2,082 elements |
| T1 | 1:52–2:00 | architecture + close | graphics | Phone → pipeline on one GPU laptop → project state → Neo4j graph → dashboard / P6 / GAEB / .ics; closing line | Technical approach |

The editor may shift a second here or there to fit the voice-over, but the total stays ≤ 2:00 and the demo part stays ≥ 85 s.

## Voice-over (draft; the editor owns the final wording, one line per shot, ids = shot ids)
The user records it in ElevenLabs afterwards; scene lengths follow the clips.
82 changes: 82 additions & 0 deletions pitch/deck/deck7/build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Builds the 7-slide submission deck: deck.html -> docs/design-brief/Tagwerk-Pitch-7.pdf
// node pitch/deck/deck7/build.mjs [--allow-missing] [--png <dir>]
// --allow-missing: images that do not exist yet (the phone stills) become labelled empty frames instead of
// failing the build; the missing files are printed.
// --png <dir>: also writes one PNG per slide for review.
// Needs puppeteer-core (taken from ../../video, ../ or the demo-video checkout) and Google Chrome.
import fs from 'node:fs'
import path from 'node:path'
import { createRequire } from 'node:module'
import { fileURLToPath, pathToFileURL } from 'node:url'

const HERE = path.dirname(fileURLToPath(import.meta.url))
const REPO = path.resolve(HERE, '../../..')
const OUT = path.join(REPO, 'docs/design-brief/Tagwerk-Pitch-7.pdf')
const CHROME = process.env.CHROME || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
const args = process.argv.slice(2)
const allowMissing = args.includes('--allow-missing')
const pngDir = args.includes('--png') ? path.resolve(args[args.indexOf('--png') + 1]) : null

function loadPuppeteer() {
const roots = [HERE, path.join(REPO, 'pitch/deck'), path.join(REPO, 'pitch/video'),
path.resolve(REPO, '../demo-video'), process.env.PUPPETEER_ROOT].filter(Boolean)
for (const r of roots) {
try { return createRequire(path.join(r, 'x.js'))('puppeteer-core') } catch { /* next */ }
}
throw new Error('puppeteer-core not found; set PUPPETEER_ROOT to a folder whose node_modules has it')
}

let html = fs.readFileSync(path.join(HERE, 'deck.html'), 'utf8')
const missing = []
html = html.replace(/<img src="([^"]+)"[^>]*>/g, (tag, src) => {
if (fs.existsSync(path.join(HERE, src))) return tag
missing.push(src)
return `<div class="missing">${src}<br>not delivered yet</div>`
})
if (missing.length) {
console.log('MISSING images:', missing.join(', '))
if (!allowMissing) { console.error('Build stopped. Use --allow-missing to build with empty frames.'); process.exit(1) }
}
const slides = (html.match(/<section class="slide/g) || []).length
if (slides > 7) { console.error(`${slides} slides: the submission allows at most 7`); process.exit(1) }

const tmp = path.join(HERE, '.deck.build.html')
fs.writeFileSync(tmp, html)
const puppeteer = loadPuppeteer()
const browser = await puppeteer.launch({ executablePath: CHROME, headless: true, args: ['--hide-scrollbars'] })
try {
const page = await browser.newPage()
await page.setViewport({ width: 1920, height: 1080, deviceScaleFactor: 1 })
await page.goto(pathToFileURL(tmp).href, { waitUntil: 'networkidle0' })
await page.evaluate(() => document.fonts.ready)
// Report content that spills out of a slide or a box.
const overflow = await page.evaluate(() => {
const out = []
document.querySelectorAll('.slide').forEach((s, i) => {
const foot = s.querySelector('.foot').getBoundingClientRect()
const sr = s.getBoundingClientRect()
s.querySelectorAll('*').forEach((el) => {
if (el.closest('.foot') || el.closest('svg')) return
const r = el.getBoundingClientRect()
if (!r.width || !r.height) return
if (r.bottom > foot.top - 4 || r.right > sr.right - 90 || r.left < sr.left + 90) {
out.push(`slide ${i + 1}: <${el.tagName.toLowerCase()} class="${el.className}"> ` +
`bottom ${Math.round(r.bottom - sr.top)} right ${Math.round(r.right)} "${el.textContent.trim().slice(0, 40)}"`)
}
})
})
return out
})
if (overflow.length) console.log('OVERFLOW:\n ' + overflow.join('\n '))
await page.pdf({ path: OUT, width: '1920px', height: '1080px', printBackground: true, preferCSSPageSize: true })
console.log(`wrote ${path.relative(REPO, OUT)} (${slides} slides, ${(fs.statSync(OUT).size / 1e6).toFixed(1)} MB)`)
if (pngDir) {
fs.mkdirSync(pngDir, { recursive: true })
const els = await page.$$('.slide')
for (let i = 0; i < els.length; i++) await els[i].screenshot({ path: path.join(pngDir, `slide-${i + 1}.png`) })
console.log(`wrote ${els.length} PNGs to ${pngDir}`)
}
} finally {
await browser.close()
fs.rmSync(tmp, { force: true })
}
Loading
Loading