[repo] Workspace: Review Phase 0 and record gaps, lessons and handover

Adversarial review with per-package counts and 13 reintroduced bugs, all
caught. Fixes from the review: the trace geocell is capped at 6 characters
(~1 km; 16 allowed centimetres), one forbidden-word hit per place, and an
e2e guard that meta charset stays within the first 1024 bytes.

CLAUDE.md §6.2 no longer contradicts itself about care acts; §2 and §3
say what Phase 0 actually built.
This commit is contained in:
2026-11-01 00:36:06 +01:00
parent 49c8def037
commit 6885a217cd
16 changed files with 417 additions and 27 deletions
+2 -2
View File
@@ -9,9 +9,9 @@
"properties": {
"traceId": { "description": "Random and rotating.", "type": "string", "pattern": "^[A-Za-z0-9_-]{16,64}$" },
"geocell": {
"description": "A coarse cell id. The cell system and its density-adaptive size are decided in the Phase 4 feature doc.",
"description": "A coarse cell id, at most ~1 km (CLAUDE.md §4). Capped at 6 characters: a 6-character geohash is ~1.2 x 0.6 km, and every character more is ~5x finer, down to centimetres. The cell system and its density-adaptive size are decided in the Phase 4 feature doc.",
"type": "string",
"pattern": "^[a-z0-9]{4,16}$"
"pattern": "^[a-z0-9]{3,6}$"
},
"dayBucket": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"gesture": { "type": "string", "enum": ["petal", "light"] },
+6
View File
@@ -109,4 +109,10 @@ describe('trace', () => {
it('rejects a precise coordinate in place of a cell', () => {
expect(validateTrace({ ...trace, geocell: '50.0755,14.4378' }).ok).toBe(false);
});
it('rejects a cell finer than ~1 km: a long geohash is a house, not a district', () => {
expect(validateTrace({ ...trace, geocell: 'u2fkbn' }).ok, '6 chars, ~1.2 km').toBe(true);
expect(validateTrace({ ...trace, geocell: 'u2fkbnx' }).ok, '7 chars, ~150 m').toBe(false);
expect(validateTrace({ ...trace, geocell: 'u2fkbnxq9vk2' }).ok, '12 chars, ~4 cm').toBe(false);
});
});