Purpose: collect what we have already aligned on, what is explicitly deferred, and what still needs a decision before the next engineering doc revision.
Date: 2026-04-11 Scope: backend product logic, report logic, radius logic, building-signal handling, and frontend/backend interface assumptions
This is not the final engineering document.
It exists to prevent the team from re-opening already-settled questions while we continue refining:
- report generation
- overview/detail split
- radius-dependent logic
- building-level signal handling
- frontend/backend handshake
Use this document as the current decision ledger for v3.7 planning.
These items are already aligned well enough to treat as current working decisions.
The current product interpretation is:
overviewhelps the user locate problem areas on the mapdetailperforms the real local analysis after a click- the local report is generated only in
detail
Overview does not generate a report.
The current expected interaction is:
- user clicks a point on the map
- user chooses:
- radius
- priority order
- user clicks a confirm/generate button
- backend runs the full detail pipeline
- backend returns the final report
This means:
- changing controls does not have to trigger LLM generation immediately
- the confirmed detail request is the report-generation trigger
The currently agreed radius set is:
200m500m1000m
These should be treated as product-level options, not arbitrary free-form numeric input.
User priority ranking affects:
- detail priority weights
- detail
priority_actions - report emphasis
User priority ranking does not affect:
- overview layer generation
- overview map permutations
Overview should stay:
- one overall map
- one map per single category button
Current preferred choice: Option 4A
Interpretation:
- building-related signals should be represented as a separate detail section
- they do not have to be one of the user-drag main categories
- they should remain visible and explorable in detail mode even if the main user categories are only safety / traffic / facilities
This allows:
- cleaner building-specific reasoning
- future building markers / styling in the frontend
- less confusion between "area-level pressure" and "this nearby building has an issue"
The report must be oriented toward:
- concrete conclusions
- concrete local priorities
- concrete evidence-backed interpretation
It must not read like:
- a generic neighborhood summary
- a metric dump
- a bland restatement of counts
However, the report prompt should not over-script the exact paragraph sequence or force rigid canned wording.
The model should be guided to:
- write specific conclusions
- adapt to the actual evidence
- describe both positive and negative findings honestly
- avoid assuming the answer must sound alarming
In other words:
- direction must be strict
- writing surface can stay flexible
The detail report should clearly state:
- selected point
- selected radius
- some basic context such as borough / ZIP if available
This is required so the user does not confuse:
- point-level building findings
- radius-level local context
- ZIP-level service proxies
This section captures the current backend proposal that still needs one more team review, but is already stable enough to draft against.
These should use the chosen radius directly:
- collisions
- rodent inspections
- 311 complaints
- restaurant inspections
- LinkNYC
- public toilets
- street trees
- other point/facility context datasets
Recommended method:
- bbox coarse filter
- haversine exact filter
- aggregate within selected radius
Building-linked signals should not expand all the way to 1000m.
Recommended rule:
building_radius = min(selected_radius, 250m)
So:
- if selected radius is
200m, building radius is200m - if selected radius is
500m, building radius is250m - if selected radius is
1000m, building radius is still250m
Applies to:
- housing violations
- AEP
- other future building-specific datasets
These should remain area/ZIP context proxies:
- EMS
- Fire
- future ZIP/CD aggregate service metrics
Report language should make clear that these are:
- area-level context
- not exact point-radius measurements
First-pass proposal:
- use radius-based access / nearby proxy for point interaction
- allow acreage / polygon measures to stay approximate for now
- explicitly mention approximation in
data_gapswhen needed
This remains a provisional rule and may be revised when frontend and data processing are clearer.
Changing radius changes raw counts.
Therefore, severity should not rely on raw counts alone.
Current preferred direction:
- long-term: build radius-specific baselines for
200m,500m,1000m - interim fallback: use density or radius-normalized scaling to reduce trivial count inflation
This is still an engineering item to be finalized.
The model should receive already-computed:
priority_actionswhy_nowcurrent_stateevidence_tabledata_gaps- target context
- selected radius
- selected priority order
The model should not be the source of:
- ranking
- trend detection
- factual selection
Prompt guidance should require the model to:
- produce concrete local conclusions
- lead with what should be prioritized
- explain why those issues rose to the top
- mention the selected radius explicitly
- include basic local context
- stay faithful to actual evidence whether results are good, bad, mixed, or sparse
Prompt guidance should avoid:
- forcing a fake alarmist tone
- forcing a fake optimistic tone
- forcing one rigid paragraph template regardless of evidence
- turning the report into a generic summary
The report should aim for statements like:
- "Within the selected 500m radius, street-safety pressure remains elevated relative to baseline and should be checked first."
- "The strongest nearby building pressure comes from serious housing violations within the building-radius window, not from broader facilities scarcity."
- "ZIP-level emergency response metrics suggest service pressure in the surrounding area, but they should not be interpreted as exact point-level response time."
The report should avoid statements like:
- "There are many data points nearby."
- "The area has some issues and some amenities."
- "Overall things look mixed."
This section is not about frontend color or rendering decisions.
It is about what the backend should be prepared to output so the frontend can later decide how to style it.
Backend should eventually support an aggregated building-stress signal for overview cells, for example:
building_stress_scorebuilding_signal_countbuilding_stress_level
This supports future map styling without forcing the backend to decide colors.
Backend should support per-building or near-building detail objects such as:
bblbinlatitudelongitudeflag_typeseveritylabelscore_hintsummary
These can feed:
- markers
- building cards
- side panels
- future styling layers
The backend should decide:
- score
- level
- flag
- object identity
The frontend should decide:
- color
- icon
- opacity
- layering
- rendering style
This separation is intentional and should remain.
These topics are real, but they are not blockers for the next report/detail design step.
Watchlist was discussed previously as batch reuse of detail logic.
At this stage it is deferred from the current decision cycle because:
- the current main interaction is point click + confirm report
- the team is still finalizing detail/report logic
- watchlist is not necessary to settle the current radius/report questions
Current temporary understanding:
- watchlist remains a batch/automation mode
- it does not drive the current report design decision
- it can be revisited after detail/report logic stabilizes
Frontend styling for buildings and map layers is still pending.
We should not block backend scoring/output structure on those UI choices.
These remain open after the current discussion.
Need to decide:
- do we build true separate baselines for
200m,500m, and1000mnow - or do we ship a density-normalized interim approach first
Need to decide:
- exact first-pass method for parks and other large polygons
- whether acreage stays approximate in v3.7
- how explicitly to surface that approximation in
data_gaps
Possible direction:
- include a lightweight
overview_contextblock for the clicked point's containing cell
Need to decide:
- is this in scope for the next report revision
- or is it postponed until after the first detail report pass is stable
Currently expected:
- selected point
- selected radius
- borough if available
- ZIP if available
- active priority order
Need final confirmation that this is the minimum required context block.
Need to decide:
- whether building-level outputs should always include a normalized
score_hint - whether backend should emit both numeric score and categorical severity
- how much of that should be considered stable contract vs experimental
Need to confirm:
- does frontend show a preview state before the user clicks confirm
- or does it only show the final generated detail result after confirmation
This affects:
- when deterministic detail computation runs
- whether report generation is the same request or a later request
Before the next full engineering doc revision, the team should next confirm:
- radius-specific baseline strategy
- parks/polygon approximation approach
- whether
overview_contextenters the first detail report version - the minimum required context block for the report
- whether frontend has a preview stage before confirm
Everything else in this document can already be treated as current working direction.
Current stable direction:
- overview locates problem areas
- detail is where the real report happens
- user confirms radius + priority order before report generation
- radius options are
200 / 500 / 1000m - building signals should live as a separate detail section
- report style should aim for concrete conclusions while still allowing the LLM freedom to write naturally from the real evidence
Current deferred topic:
- watchlist
Current main unresolved items:
- radius-specific baselines
- parks/polygon handling
- whether to add overview context into the detail report
- exact stable building-output contract