Skip to content

Commit 36a034a

Browse files
author
Douglas Jones
committed
dispatch: 2026-05-21 session dispatches + 2026-05-22 DTS hardening pass
2026-05-21 dispatches: - auto-torch-and-nearby-cache-fixes - deploy-and-data-reset - golden-record-authority-requirements - golden-record-retention - gps-warmup-and-location-pill - session-close-2 through session-close-5 - sign-condition-detection - vision-ocr-hardening - xcode-session-code-review 2026-05-22 dispatches: - dts-hardening (cache invalidation, iOS NearbySignsCache, deps) Also: updated 04-adversarial-review.md steering file
1 parent 694cff3 commit 36a034a

28 files changed

Lines changed: 1312 additions & 1 deletion

.kiro/steering/04-adversarial-review.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,33 @@ No two reviews use the same AI model. B-Team and Zero-Context use different mode
2222

2323
---
2424

25+
## Recommended Models by Role
26+
27+
### A-Team (Builder)
28+
Frontier models with large context windows. Best for generation, refactoring, and multi-file reasoning.
29+
- Claude Sonnet 4.5 / Claude Opus 4
30+
- GPT-4o
31+
- Gemini 2.5 Pro
32+
33+
### B-Team (Adversarial Code Reviewer)
34+
**Use reasoning/thinking models.** These grind through logic systematically rather than pattern-matching to the most plausible answer. They are less susceptible to the RLHF bias toward confirming that code looks reasonable. They find more bugs.
35+
- **Qwen3** (recommended — strong adversarial posture by default, extended thinking)
36+
- **o3** (OpenAI — deep reasoning, excellent at security and correctness)
37+
- **DeepSeek-R1** (strong reasoning, good for logic and edge-case analysis)
38+
- Claude with extended thinking enabled
39+
40+
Do **not** use the same model family as the A-Team for B-Team review. If Claude built it, do not use Claude to review it.
41+
42+
### Zero-Context Reviewer
43+
Any capable model that has **not** seen the project context. The goal is a naive read — fresh eyes catch undocumented assumptions.
44+
- Gemini 2.5 Flash (fast, low cost, good for doc/API surface review)
45+
- GPT-4o mini
46+
- Any model in a clean session with no system prompt or project files
47+
48+
---
49+
50+
---
51+
2552
## How to Run a B-Team Review
2653

2754
### Step 1: Prepare the Review Package
@@ -30,7 +57,7 @@ Concatenate the relevant artifacts into a single document. The B-Team must also
3057

3158
### Step 2: Use the B-Team System Prompt
3259

33-
The full B-Team system prompt is in `02-personas.md`. Copy it into a **different AI** (GPT-4o, Gemini, etc.).
60+
The full B-Team system prompt is in `02-personas.md`. Copy it into a **reasoning model** (Qwen3, o3, DeepSeek-R1 — see Recommended Models above). Do not use the same model family that built the code.
3461

3562
### Step 3: Submit the Spec/Code
3663

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# DecodeTheSign — Auto-Torch Leak Fix + Nearby Cache Server Wiring
2+
3+
**Date:** 2026-05-21
4+
**Persona:** Quill
5+
**Project:** DecodeTheSign (iOS + API)
6+
**Gate:** Fast-track defect fix (found via code review of Xcode Claude session)
7+
8+
---
9+
10+
## What happened
11+
12+
Code review of the Xcode Claude session (382c6cc1, last 4 hours) found two issues
13+
that should have been caught before the sub-agent's work was accepted. They were
14+
not caught because sub-agent output was accepted without reading the changed files.
15+
That standard has been corrected.
16+
17+
---
18+
19+
## Defect 1: Auto-torch stays on after scan (ScanView.swift)
20+
21+
**Root cause:** The Xcode Claude session added auto-torch in low light:
22+
```swift
23+
if !isTorchOn && camera.isLowLight() {
24+
isTorchOn = true
25+
camera.setTorch(true)
26+
}
27+
```
28+
The torch was turned on but never turned off. `camera.reset()` does not touch
29+
torch state. Result: torch fires in low light and stays on for every subsequent
30+
scan until the user manually toggles it off. Battery drain + confusing UX.
31+
32+
**Fix:** Track `autoEnabledTorch` as a local `let` before the photo. Turn off
33+
in all 7 exit paths: photo capture fail, Vision reject, imageData nil, on-device
34+
success, Gemini success, lowConfidence, notASign, failure, timeout, network error.
35+
36+
---
37+
38+
## Defect 2: client_nearby_spots sent but server ignored it
39+
40+
**Root cause:** The Xcode Claude session added `clientNearbySigns` to
41+
`APIClient.analyzeCapture()` and the iOS app sends it in the multipart body.
42+
But the server-side capture route never parsed `client_nearby_spots` from the
43+
form — the optimization was wired on the client but dead on the server.
44+
45+
**Fix:** Server now parses `client_nearby_spots` from the multipart form.
46+
Both `getConsumerLiveNearbyData` call sites bypass the DB geospatial query
47+
when client spots are present. The iOS NearbySignsCache optimization is now
48+
active end-to-end.
49+
50+
---
51+
52+
## Process note
53+
54+
Sub-agent output must be reviewed before sign-off. "Done" from a sub-agent
55+
means the tasks were attempted — it does not mean the output is correct.
56+
Reading the changed files is not optional.
57+
58+
---
59+
60+
## Build status
61+
62+
`tsc --noEmit` exits 0. iOS simulator build clean. Committed `99b7d37c`, pushed.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
id: 2026-05-21-auto-torch-and-nearby-cache-fixes
2+
date: 2026-05-21
3+
persona: Quill
4+
project: DecodeTheSign
5+
type: defect-fix
6+
gate: fast-track
7+
source: code-review-of-xcode-claude-session
8+
9+
title: "DecodeTheSign — Auto-Torch Leak Fix + Nearby Cache Server Wiring"
10+
11+
summary: >
12+
Fixed two defects found in code review of Xcode Claude session 382c6cc1.
13+
(1) Auto-torch not turned off after scan — tracked autoEnabledTorch flag,
14+
added cleanup to all 7 exit paths. (2) client_nearby_spots sent by iOS but
15+
server never parsed it — wired server-side, DB geospatial query now bypassed
16+
when client spots present. tsc exits 0, iOS build clean, committed 99b7d37c.
17+
18+
files_changed:
19+
- path: ios-native/DecodeTheSignPackage/Sources/DecodeTheSignFeature/Views/Scan/ScanView.swift
20+
changes: ["autoEnabledTorch flag, torch cleanup in all 7 exit paths"]
21+
- path: app/api/consumer/live/[liveId]/capture/route.ts
22+
changes: ["parse client_nearby_spots from form", "bypass getConsumerLiveNearbyData when client spots present (both call sites)"]
23+
24+
git_commit: 99b7d37c
25+
26+
process_note: >
27+
Sub-agent output must be reviewed before sign-off. Reading changed files
28+
is not optional.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# DecodeTheSign — Git Commit, Data Reset, Vercel Deploy, iOS Device Deploy
2+
3+
**Date:** 2026-05-21
4+
**Persona:** Quill
5+
**Project:** DecodeTheSign
6+
**Gate:** Fast-track release prep
7+
8+
---
9+
10+
## What happened
11+
12+
Douglas requested a clean slate for testing: commit everything, wipe all
13+
crowdsourced captures, deploy API to Vercel, deploy iOS to device.
14+
15+
---
16+
17+
## What shipped
18+
19+
### Git — commit `1e512d3a`
20+
21+
All session work committed and pushed to `origin/main`:
22+
- VisionService OCR hardening
23+
- ScanView GPS warm-up + location pill + continuous refinement
24+
- capture/route isComplexSign fix + high_confidence_no_ocr inline_evaluation
25+
- consumer-crowdsource-intake replaceActiveRules + crowdsource_submission_count
26+
- cron/cleanup full retention policy
27+
- Migrations: sign_rules dedup/unique index, crowdsource_submission_count column
28+
- Steering: 07-data-model-golden-record.md
29+
- Admin route pre-existing TS error fixes
30+
31+
11 files changed, 621 insertions, 44 deletions.
32+
33+
### Database reset — clean slate
34+
35+
Deleted in FK order:
36+
37+
| Table | Rows deleted |
38+
|-------|-------------|
39+
| `consumer_feedback` | 41 |
40+
| `consumer_capture_audits` | 176 |
41+
| `consumer_sign_submissions` | 176 |
42+
| `ocr_extractions` (crowd images) | 22 |
43+
| `sign_images` (crowd) | 23 |
44+
| `sign_rules` (crowd) | 23 |
45+
| `sign_events` (crowd) | 266 |
46+
| `sign_locations` (crowd `nationwide-us-crowd-*`) | 14 |
47+
| `consumer_contributors` counters | reset to 0 |
48+
49+
Not touched: `raleigh-feed-*` authoritative signs and their rules.
50+
51+
### Vercel — `decodethesign.com`
52+
53+
Production deploy completed in 34s. All API changes live.
54+
55+
### iOS — device `DJ1Z`
56+
57+
Built Debug configuration, installed via `xcrun devicectl`.
58+
Bundle: `com.codifide.decodethesign`
59+
60+
---
61+
62+
## Ready for testing
63+
64+
Database is clean. App on device has all today's fixes. API is live.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
id: 2026-05-21-deploy-and-data-reset
2+
date: 2026-05-21
3+
persona: Quill
4+
project: DecodeTheSign
5+
type: release-prep
6+
gate: fast-track
7+
8+
title: "DecodeTheSign — Git Commit, Data Reset, Vercel Deploy, iOS Device Deploy"
9+
10+
summary: >
11+
Committed all session work (1e512d3a), wiped all crowdsourced captures and
12+
crowd-created signs from the database (clean slate for testing), deployed API
13+
to decodethesign.com via Vercel, built and installed iOS app on device DJ1Z.
14+
15+
git_commit: 1e512d3a
16+
vercel_url: https://decodethesign.com
17+
ios_device: 00008140-000235280143801C
18+
ios_bundle: com.codifide.decodethesign
19+
20+
data_deleted:
21+
consumer_feedback: 41
22+
consumer_capture_audits: 176
23+
consumer_sign_submissions: 176
24+
ocr_extractions_crowd: 22
25+
sign_images_crowd: 23
26+
sign_rules_crowd: 23
27+
sign_events_crowd: 266
28+
sign_locations_crowd: 14
29+
contributor_counters_reset: true
30+
authoritative_signs_preserved: true
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# DecodeTheSign — Golden Record Authority Requirements
2+
3+
**Date:** 2026-05-21
4+
**Persona:** Quill
5+
**Project:** DecodeTheSign
6+
**Gate:** Requirements / architectural decision
7+
8+
---
9+
10+
## What happened
11+
12+
Douglas stated the architectural principle: a high-confidence sign scan is the
13+
golden record. Data feeds run nightly but support and decorate it. When the two
14+
disagree, the capture wins.
15+
16+
Before locking this in, one flaw was identified and addressed.
17+
18+
---
19+
20+
## The flaw: high OCR confidence ≠ correct sign
21+
22+
High OCR confidence means "we read the text clearly" — not "the sign is correct."
23+
A defaced, vandalized, or partially obscured sign can be read with 0.99 confidence
24+
and produce wrong rules. "Capture wins" cannot be unconditional.
25+
26+
---
27+
28+
## The resolution: split authority by data type
29+
30+
| Field | Authority |
31+
|-------|-----------|
32+
| Parking rules (times, days, activity, arrows) | Capture wins at confidence ≥ 0.95 |
33+
| Sign existence (is_active) | Feed wins — city knows when signs are removed |
34+
| Sign location (lat/lng) | Feed wins — surveyed GIS beats phone GPS |
35+
| Sign identifier | Feed wins |
36+
37+
**Conflict guard:** when a high-confidence capture conflicts with recent feed data
38+
(< 30 days old), queue to `sign_conflicts` for human review rather than
39+
auto-overwriting. Auto-resolve in favor of capture only when no feed data exists
40+
or feed is > 30 days stale.
41+
42+
**Sign replacement scenario:** feed update → conflict queued → feed wins because
43+
capture is older. Old capture marked superseded, not deleted.
44+
45+
---
46+
47+
## What shipped
48+
49+
`steering/08-golden-record-authority.md` — permanent architectural requirement,
50+
auto-included in every session. Committed `b37f9fe5`, pushed to `origin/main`.
51+
52+
Covers:
53+
- Authority table by field type
54+
- Conflict resolution rules
55+
- Vandalism/OCR error guard
56+
- Sign replacement scenario
57+
- Implementation checkpoints (all already implemented)
58+
- What this is NOT ("crowd data always wins")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
id: 2026-05-21-golden-record-authority-requirements
2+
date: 2026-05-21
3+
persona: Quill
4+
project: DecodeTheSign
5+
type: requirements
6+
gate: architectural-decision
7+
8+
title: "DecodeTheSign — Golden Record Authority Requirements"
9+
10+
summary: >
11+
Formalized the golden record authority model: capture wins on rules at
12+
confidence >= 0.95; feed wins on existence and location. Added vandalism/OCR
13+
error guard (conflict queue when feed is recent). Sign replacement handled
14+
via conflict queue with feed winning on age. Committed as steering/08.
15+
16+
files_changed:
17+
- path: .kiro/steering/08-golden-record-authority.md
18+
changes: ["New permanent architectural requirement — authority by field type, conflict resolution, vandalism guard, sign replacement scenario"]
19+
20+
git_commit: b37f9fe5

0 commit comments

Comments
 (0)