# Stoa · trace the answer

From `/work`, run:

```sh
python3 server.py --port 8000
```

Open **http://127.0.0.1:8000/demo/**. Stop with Ctrl-C. The server binds only to 127.0.0.1. `launch.json` launches this actual server: a plain `python3 -m http.server` cannot implement the required POST API, source validation or lazy geometry.

Dependencies already available in the inspection runtime: Python 3 with PyMuPDF, ifcopenshell, ezdxf and Shapely; Node.js for the preserved BIM adapter. Three.js and OrbitControls are included locally. No network dependencies, credentials, downloaded models or paid APIs.

Original inputs remain read-only at `/challenge/inputs/data`. Set `STOA_SOURCE_ROOT` to an equivalent data root if relocating. Everything else needed is in `/work`. Prepared baseline geometry is portable; generic metadata and PDF images are content-hash cached locally. There are no deliverable symlinks.

## Start here

- A700 opens on **How many U01 unit doors are scheduled on A700?** and shows **71 U01 unit doors** beside the original Count cell. Full-question suggestions offer row count and source details. The all-type total remains available as `sum`, with its gate/panel/opening caveat in the expandable evidence details.
- Search **A-801**. `Area for room 121` highlights its 2,470 SF source cell. `sum` explicitly reports an incomplete subtotal because two rows are nonnumeric. Switch to Door schedule and try `Count doors type A1` or `Count doors material WD-1`.
- Use the **source-field selectors → Filter / Group** to recompute from exact authored fields. Open **Selected source fields** and select a field to highlight that original cell. Source codes are preserved, not silently interpreted as performance specifications.
- Search **kit-fzk** and choose the IFC. Try `Net room area by floor`, `Count walls`, or `Net volume of walls`. Select contributors, orbit, isolate, or separate authored storeys. The **3D models** link preserves the complete accepted KIT/Hub viewer, source layers and original English/German query engine.
- Search **Gdynia** to see missing standard room quantities abstain, or **Frigento** to count authored walls. Frigento has no IfcSpace objects; that is missing room coverage, not a physical zero-room claim.
- **A-701** has no validated schedule and does not borrow one from another sheet. Drawing evidence preserves the accepted Swiss DXF/PDF/PNG journey.

See [the human-paced walkthrough](WALKTHROUGH.md), [actual recording](../evidence/walkthrough.webm), [implementation and limitations](../implementation.md) and [review](../review.md).

## Reproduce

```sh
python3 scripts/import_sources.py 'opening_design/CTR/Most Current Set/Full size sheets/A700 - SCHEDULES.pdf'
python3 scripts/validate_sources.py
python3 scripts/validate_pdf_fields.py
python3 scripts/unit_validation.py
bash scripts/api_validate.sh
bash scripts/final_browser.sh
```

The importer is standalone: it does not extract functions manually from an experiment. Test scripts write named outputs; copy them and change output names before rerunning if preserving the current evidence snapshot. Browser scripts retain server PIDs, redirect stdin/stdout/stderr and stop servers on exit. `POST /api/query` accepts `{path, question}`; optional `table`, `floor`, `kind`, `adapter:"generic"` select the new adapter. Existing KIT/Hub requests without the adapter retain the accepted baseline engine. Paths accept data-root-relative, `data/` and `inputs/data/` aliases; traversal and unknown sources are rejected.

## Reuse and terms

Reused from `inputs/baseline`: the complete drawing engine/UI, KIT/Hub query engine, model geometry, source groups, exploded viewer, local Three.js and licenses. The new home page, generic source adapter, source-field query pipeline and exact PDF overlay are implemented here. Historical baseline evidence is under `evidence/baseline`; its external aggregate evaluation applies only to those immutable checkpoints, not to this extension.

OpeningDesign schedules retain CC BY-SA 4.0 / MIT credits. Swiss Dwellings retains CC BY 4.0 credits. IFC models have per-file terms: see `licenses/` and the original source folders' `LICENSE.md`. Non-commercial challenge use. No reference answers were accessed. Runtime model/API calls are zero. Development used existing OpenAI via Codex, which processes inspected source content externally; unavailable development monetary cost is **null**, not zero.

## Review-driven room scope repair

Quoted source room identities are enforced. `Net room area for "Wohnen"` uses that room's authored quantity and GlobalId. `Count walls in "Wohnen"` explicitly abstains: this adapter does not validate complete room-to-element membership from space boundaries/containment. Boundary records may exist in the source; their presence alone is not a validated counting policy. Conflicting rooms/floors and unknown qualifiers do not fall back to whole-model totals.

Focused reproduction: `python3 scripts/room_scope_regression.py`, `node scripts/room_scope_regression.mjs`, and `bash scripts/room_scope_final.sh`. These scripts write named evidence outputs; use new output names for subsequent retained rounds. See `../revisions/latest.md` for the measured failure and retained repair. Launch remains `python3 server.py --port 8000`.

## Release link and source-timing validation

Before packaging, run `python3 scripts/check_evidence_links.py`. It scans every HTML, JS, JSON and Markdown file in `demo/`, and exits nonzero for a dangling `../evidence/` reference or a target outside `evidence/`. Retained baseline evidence links point into `evidence/baseline/`; those historical measurements are not new release measurements.

`bash scripts/release_links_final.sh` checks the real IFC → PDF → IFC timing disclosure, expanded desktop/mobile PDF evidence, live evidence URLs, receipt/source retrieval and room-scope abstention. It starts and stops its own bounded local server. It writes `evidence/release-links/final-*`; use fresh names before repeating retained evidence. Source changes clear geometry-batch timing, and the PDF panel shows original PDF cells without an unrelated IFC batch duration. Launch and dependencies are unchanged.

## Current-source receipts

Source changes clear the previous answer, selection, contributors, source link and geometry state immediately. Export is unavailable until a current answer exists. PDF receipts carry original cell evidence and omit inapplicable IFC geometry; IFC receipts retain only the currently loaded model's IDs. Late responses from prior source/question requests cannot restore stale evidence. The receipt records the submitted question even if the question editor was subsequently changed.

Focused checks: `bash scripts/source_receipts_browser.sh after`, `bash scripts/source_receipts_races.sh`, `python3 scripts/source_receipts_regression.py`, `node scripts/source_receipts_regression.mjs`. They write under `evidence/source-receipts/`; choose fresh stage/output names before repeating retained runs. Race checks deliberately delay a real mesh response and inject a metadata failure. Launch/dependencies are unchanged. See `../revisions/latest.md` for before/after results and limits.

## Room-area revision (OP4)

Try the source-derived room example button in the generic IFC viewer. Quoted rooms resolve by `LongName (Name)`, LongName or Name, within a quoted source storey. English, Estonian, Dutch, Spanish, Danish, German and Polish room-area and storey-total grammars are supported. Missing/ambiguous identities or missing explicit NetFloorArea abstain; generic area fields and gross areas do not substitute for net. Paired plan PDFs explicitly identify the IFC evidence source. Selected rooms retain actual meshes, GlobalIds, quantity-set/name, units and storey.

Search **molio**, then ask `What is the net floor area of the room "Toilet (Rum nr. 411)" on "4. Sal", in m²?`. `Count staircases` counts root IfcStair assemblies using source decomposition, excluding nested stair parts. Raw class inventory still includes all entities. Counts use `count` units. Large source metadata can be expensive to load; geometry remains bounded and lazy.

[Current coverage and per-source abstentions](../evidence/room-area/coverage-summary.json): 962/2,218 generic area prompts supported, compared with 50 before this revision; this is support coverage, not reference accuracy. [Source checks](../evidence/room-area/checks-final.json) and [retained baseline regression](../evidence/room-area/preserved-regression.json) document the distinction. Run `python3 scripts/room_area_checks_final.py` and `bash scripts/room_area_api_final.sh` to reproduce focused tests. Standalone source import remains `python3 scripts/import_sources.py SOURCE_PATH`.


## Cold-start and English revision (OP5 / review-016 F1)

All three pages share **stoa** navigation: Schedules, Drawings, 3D models. The dedicated 3D page starts exploded with the answer visible. Generic models keep a compact answer, evidence-check score, query time and scope immediately above the mobile scene; Show answer and contributor selection reveal that strip with the evidence.

Try **How many doors are on the ground floor?**, **How many rooms are on the upper floor?**, **How big is the living room?**, **What is the area of the kitchen?**, **How many bathrooms?**, **What is the total floor area?**, or **Which software was used?**. These work through the generic adapter and the dedicated KIT/Hub viewer. The visible interpretation states actual source names. Ground is the lowest nonnegative authored elevation; first is the next distinct elevation; upper/basement must identify one storey. Room-type synonyms match exact source names; duplicate/missing names abstain. Floor area uses explicit space NetFloorArea first, then the documented source-authored area properties described below; never gross quantity substitution or unvalidated inferred geometry. Designer attribution remains unsupported where a validated designer identity is unavailable; software metadata does not identify a building designer.

Checks for this revision: `python3 scripts/cold_checks.py`, `node scripts/cold_preserved.mjs`, `python3 scripts/cold_scope_final.py`, `bash scripts/cold_journey.sh NEW_STAGE`, `bash scripts/cold_receipts.sh NEW_STAGE`. Scripts with fixed evidence filenames should be copied with new output paths before another retained run. Browser scripts start/stop their own bounded local server. No new runtime dependencies. See [revision evidence](../revisions/latest.md). These are source/baseline checks, not new benchmark accuracy.

## Scope-state release (OP6 / review-019 F1)

Continuation validation: run `python3 scripts/check_revision_links.py` alongside the evidence-link check before handoff. It verifies that `revisions/latest.json` accounts for real current feedback IDs and points to existing relative evidence files. Current OP6 includes review-019 F1's mobile requirement. This structural check does not establish answer correctness; fresh browser/API evidence and explicitly reused regressions are documented in the current revision report.

A question-derived floor no longer carries into the next question. After ground-floor doors, asking **How many windows are there?** uses the whole model; **How many rooms are on the upper floor?** resolves the new floor. A floor chosen manually persists and is labelled **on Erdgeschoss (selected)**. Conflicting manual/question scopes abstain with the reason beside the mobile answer; select **Whole model** to clear the manual filter and retry. Explicit whole-model wording retains the existing override. Changing sources clears manual scope.

The same constrained English floor/room grammar now works through bare `POST /api/query` requests with `path` and `question`, as well as the generic adapter. Source quantities and the preserved query engine are unchanged.

Focused reproduction: `bash scripts/scope_state_browser.sh NEW_STAGE`, `bash scripts/scope_state_api.sh NEW_STAGE`, `bash scripts/scope_state_edges.sh`, `node scripts/scope_state_preserved.mjs`, `python3 scripts/scope_state_regression.py`. Fixed-output scripts must be copied to fresh output names before repeating retained evidence. Launch and dependencies are unchanged. See [current revision](../revisions/latest.md) for measured before/after behavior and validation limits.


## IFC coverage revision (OP7)

Try the generic source search **esplanades**, then **What is the net floor area of the room 'KORIDOR (119)' on '1.korrus', in m²?**. The result is labelled with `AR_Ruum.120_Pindala`, has the source GlobalId and highlights the actual space. Floor-plan counts accept full questions such as **How many doors are shown on the floor plan of 'Erdgeschoss'?**; supported multilingual templates retain exact floor names.

Current ordered room-area fallback: `AR_Ruum.120_Pindala`, `Dimensions.Area`, only when standard NetFloorArea is absent and the authored value is positive, finite and numeric. OP8 removes `PSet_Revit_Dimensions.Area` and `GSA Space Areas.GSA BIM Area`: they do not establish net floor area. Missing, zero, nonnumeric or ambiguous authored values abstain; partial storey sums are not supported complete totals. Units come from an explicit property override or independent project AREAUNIT. These are labelled authored room-area assertions, not geometric net-floor validation. Geometric fallback remains unavailable: sampled space footprints failed the requested 2% agreement gate. Unknown descriptive model labels still abstain.

The original metadata importer remains `python3 scripts/import_sources.py SOURCE_PATH`. Authored-area supplements are extracted lazily on the first relevant question and hash-cached. Query time includes any first supplement work; its creation CPU/wall timing is separately shown in details. No new dependencies, downloads or model calls. Launch remains `python3 server.py --port 8000`.

New checks and before/after coverage are in [OP7 evidence](../evidence/ifc-coverage/summary.json). Reproduce with `python3 scripts/ifc_coverage_revision.py NEW_STAGE` and `bash scripts/ifc_coverage_browser.sh NEW_STAGE`; use new output stage names to preserve historical records. Independent review is pending.

## Net-area semantics repair (OP8)

Current supplied-prompt support is **2,141/3,062**, after 318 previously accepted room/aggregate answers were correctly changed to abstentions. This is support coverage, not reference accuracy. All retained answers preserve their values, units and contributor IDs; the prior 2,459 support count is historical. See [per-source coverage](../evidence/net-area-repair/coverage-summary.json) and [revision report](../revisions/latest.md).

Reproduce with `python3 scripts/net_area_checks.py`, `python3 scripts/net_area_source_check.py`, `node scripts/net_area_preserved.mjs`, and `bash scripts/net_area_browser.sh NEW_STAGE`. Fixed-output checks should be copied to fresh output paths before repeated retained runs. Launch, dependencies, source files and lazy geometry are unchanged. Raw hash-cached property supplements remain reusable; the current query policy validates cached values and rejects non-net properties.
